#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;

LL datas[3005];
LL LCM(LL X, LL Y)
{
	LL ret=(X*Y)/__gcd(X, Y);
	return ret;
}
int main()
{
	int n;
	scanf("%d", &n);
	LL tr=1;
	for(int a=0;a<n;a++)
	{
		scanf("%lld", &datas[a]);
		tr=LCM(tr, datas[a]);
	}
	tr--;
	LL hasil=0;
	for(int a=0;a<n;a++)
	{
		hasil+=(tr%datas[a]);
	}
	printf("%lld\n", hasil);
	return 0;
}
