#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long r = a % b;
  if (r == 0) {
    return b;
  } else {
    return gcd(b, r);
  }
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  long long m = 1;
  for (long long &i : a) {
    cin >> i;
    m = lcm(m, i);
  }
  int ans = 0;
  for (int(i) = 0; (i) < (n); (i)++) {
    ans += (m - 1) % a.at(i);
  }
  cout << ans << endl;
  return 0;
}
