// God be praised
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;
typedef uint64_t ll;
ll A[N];

int main () {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n;
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}

	ll cur = A[0];
	for (int i = 1; i < n; i++) {
		cur = (cur * A[i]) / __gcd(cur, A[i]);
	}

	cur--;
	// cout << cur << endl;

	ll ans = 0;
	for (int i = 0; i < n; i++) {
		ans += cur % A[i];
	}

	cout << ans << endl;
	return 0;
}