#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
long long gcd(long long x, long long y) {
  if (x < y) {
    long long temp = x;
    x = y;
    y = temp;
  }
  long long r = x % y;
  while (r != 0) {
    x = y;
    y = r;
    r = x % y;
  }
  return y;
}
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  long long tmp_lcm = (a[0] * a[1]) / gcd(a[0], a[1]);
  for (int i = 2; i < N; i++) {
    tmp_lcm = (tmp_lcm * a[i]) / gcd(a[i], tmp_lcm);
  }
  int ans = 0;
  for (int i = 0; i < N; i++) {
    ans += (tmp_lcm - 1) % a[i];
  }
  cout << ans << endl;
}
