#include <bits/stdc++.h>

using namespace std;
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define MAXN 201010
typedef long long int ll;
typedef pair<int, int> pii;

ll mmc(ll a, ll b){
	return a * (b / __gcd(a, b));
}

ll n, m, v[MAXN], ans;

int main(){
	scanf("%lld", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%lld", &v[i]);
		if(i == 0) m = v[i];
		else m = mmc(m, v[i]);
	}
	m--;
	
	for (int i = 0; i < n; i++)
	{
		ans += (m % v[i]);
	}
	printf("%lld\n", ans);
	
	
	return 0;
}
