#include <bits/stdc++.h>
using namespace std;
bool is_prime(int k) {
  for (int j = 2; j * j <= k; j++) {
    if (k % j == 0) {
      return false;
    }
  }
  return true;
}
long long gcd(long long a, long long b) {
  long long r = 1;
  if (a < b) {
    long long tmp = a;
    a = b;
    b = tmp;
  }
  if (b == 1) {
    return r;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
long long lcm(long long a, long long b) {
  long long r = a * b / gcd(a, b);
  return r;
}
int main() {
  stringstream ss;
  int N;
  cin >> N;
  long long a[N + 1];
  for (int i = 1; i <= N; i++) {
    cin >> a[i];
  }
  long long modnum = 1;
  for (int i = 1; i <= N; i++) {
    modnum = lcm(modnum, a[i]);
  }
  long long ans = 0;
  for (int j = 1; j <= N; j++) {
    ans += (modnum - 1) % a[j];
  }
  cout << ans << endl;
  return 0;
}
