#include <bits/stdc++.h>
using namespace std;
int a[3001];
long long m = 1;
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long lcm(long long x, long long y) {
  long long g = gcd(x, y);
  x /= g;
  return x * y;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    m = lcm(m, a[i]);
  }
  long long f = 0;
  for (int j = 0; j < n; j++) {
    f += (m - 1) % a[j];
  }
  cout << f << endl;
  return 0;
}
