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