#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
LL a[10000];
LL n;
int main()
{

	cin>>n;
	LL cnt=1;
	for(int i=0;i<n;i++){
		cin>>a[i];
		LL t=__gcd(a[i],cnt);
		cnt=cnt/t*a[i];
	}
/*	if(n!=0)
		ans=a[0];
	for(int i=1;i<n;i++)
		ans=__gcd(a[i],ans);*/
	//cout<<ans<<endl;
	LL m=cnt-1;
    LL ans=0;
		for(int i=0;i<n;i++)
			ans+=m%a[i];
		cout<<ans<<endl;
	return 0;
}

