#include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
int a;
while(scanf("%d",&a)&&a!=0){
int k[100];
int i,j,t,sum=0,flag=1,max=600;
for(i=0;i<a;i++){
scanf("%d",&k[i]);
sum+=k[i];
if(k[i]<2)
flag=-1;
if(max>k[i])
max=k[i];
}
if(flag==-1)
printf("%d\n",flag);
else
printf("%d\n",sum-max+2);
}
}