#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const int maxn =1e5+10;
int n;
int a[200];
int ans;
int main()
{
while(~scanf("%d",&n)&&n)
{
for(int i=1;i<=n;i++)scanf("%d",&a[i]);
sort(a+1,a+1+n);
if(a[1]<2)
{
printf("-1\n");
continue;
}
ans=2;
for(int i=2;i<=n;i++)ans+=a[i];
printf("%d\n",ans);
}
}