#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using in6 = int64_t;
using ind = double;
in6 gcd(in6 a, in6 b) {
  if (a % b == 0) {
    return (b);
  } else {
    return (gcd(b, a % b));
  }
}
in6 lcm(in6 a, in6 b) { return a * b / gcd(a, b); }
int main() {
  int n;
  cin >> n;
  vector<in6> data(n);
  for (int i = 0; i < (int)(n); i++) cin >> data[i];
  in6 ans = data[0];
  for (int i = 1; i < n; i++) {
    ans = lcm(data[i], ans);
  }
  ans--;
  in6 sum = 0;
  for (int i = 0; i < (int)(n); i++) {
    sum += ans % data[i];
  }
  cout << sum << endl;
}
