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

const int N = 3e3 + 5;
typedef long long ll;
ll A[N];

int main () {
	int n;
	scanf("%d", &n);

	for (int i = 0; i < n; i++) {
		scanf("%lld", &A[i]);
	}

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

	cur--;
	// printf("%lld\n", cur);

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

	printf("%lld\n", ans);
	return 0;
}