#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (x % y == 0) {
    return y;
  } else {
    return gcd(y, x % y);
  }
}
long long lcm(long long x, long long y) { return x * y / gcd(x, y); }
int main() {
  long long num;
  long long cnt = 0;
  long long kekka = 0;
  cin >> num;
  vector<long long> vec(num);
  for (long long i = 0; i < num; i++) cin >> vec.at(i);
  long long tmp = vec.at(0);
  for (long long i = 1; i < num; i++) {
    cnt = lcm(tmp, vec.at(i));
    tmp = cnt;
  }
  cnt--;
  for (long long i = 0; i < num; i++) {
    kekka += cnt % vec.at(i);
  }
  cout << kekka;
}
