#include <bits/stdc++.h>
using namespace std;
long long int f(vector<long long int> a, long long int m) {
  long long int ret = 0;
  for (int i = 0; i < a.size(); i++) {
    ret += m % a[i];
  }
  return ret;
}
long long int gcd(long long int x, long long int y) {
  long long int tmp;
  while (x % y != 0) {
    tmp = y;
    y = x % y;
    x = tmp;
  }
  return y;
}
int main() {
  int N;
  cin >> N;
  vector<long long int> a(N);
  long long int tmp;
  long long int lcm;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (i == 0) {
      tmp = a[0];
      continue;
    }
    tmp = tmp * a[i] / gcd(tmp, a[i]);
  }
  cout << f(a, tmp - 1) << endl;
  return 0;
}
