#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7, MOD = 1e9 + 7;
const long long LINF = 1e18;
const long long dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
signed main() {
  long long n;
  cin >> n;
  long long a[n], Cmp;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < n - 1; i++) {
    if (i)
      Cmp = lcm(Cmp, a[i + 1]);
    else
      Cmp = lcm(a[0], a[1]);
  }
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    ans += (Cmp - 1) % a[i];
  }
  cout << ans << '\n';
  return 0;
}
