#include <bits/stdc++.h>
using namespace std;
long long lcm(long long a, long long b) {
  long long x = a * b;
  if (a < b) {
    long long tmp = a;
    a = b;
    b = tmp;
  }
  long long r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return x / b;
}
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  long long lc = 1;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    lc = lcm(lc, a[i]);
  }
  long long sum = 0;
  long long M = 0, Mi;
  for (int j = 0; j < a.size(); j++) {
    sum += (lc - 1) % a[j];
  }
  cout << sum << endl;
}
