#include <bits/stdc++.h>
using namespace std;
int N;
const int MAX_N = 3000;
int a[MAX_N];
int f(int m) {
  int ret = 0;
  for (int i = 0; i < N; i++) {
    ret += m % a[i];
  }
  return ret;
}
int gcd(int a, int b) {
  int large = max(a, b);
  int small = min(a, b);
  if (small == 0)
    return large;
  else
    return gcd(small, large % small);
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> a[i];
  int LCM = a[0];
  for (int i = 1; i < N; i++) {
    LCM = a[i] * LCM / gcd(a[i], LCM);
  }
  cout << f(LCM - 1) << endl;
  return 0;
}
