#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main(){
int n;
while(cin>>n,n){
int min,t,sum;
cin>>min;
sum=min;
for(int i=2;i<=n;i++){
cin>>t;
sum+=t;
min=t<min?t:min;
}
if(min<2) cout<<-1<<endl;
else cout<<sum-min+2<<endl;
}
}