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