#include <bits/stdc++.h>
using namespace std;
long long lcm(long long a, long long b) {
  unsigned long long r, x, tmp;
  x = a * b;
  if (a < b) {
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return x / b;
}
int main() {
  int x;
  cin >> x;
  int y[3010];
  long long z = 1;
  for (int a = 0; a < x; a++) {
    cin >> y[a];
    z = lcm(y[a], z);
  }
  long long ans = 0;
  for (int b = 0; b < x; b++) {
    ans += (z - 1) % y[b];
  }
  cout << ans << endl;
  return 0;
}
