#include <bits/stdc++.h>
using namespace std;
long gcm(long a, long b) {
  long result = a;
  long k = 0;
  long n = b;
  do {
    k = result % n;
    result = n;
    n = k;
  } while (k != 0);
  return result;
}
long lcm(long a, long b) {
  long g;
  g = gcm(a, b);
  return a * b / g;
}
long lcm_n(long *numbers, long n) {
  long l;
  l = numbers[0];
  for (long i = 1; i < n; i++) {
    l = lcm(l, numbers[i]);
  }
  return l;
}
int main() {
  int n;
  cin >> n;
  long a[n];
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  long m = lcm_n(a, n) - 1;
  long ans = 0;
  for (int i = 0; i < (int)(n); i++) ans += m % a[i];
  cout << ans << endl;
  return (0);
}
