#include <bits/stdc++.h>
using namespace std;
long long int bai(long long int a, long long int b) {
  long long int r, x, temp;
  x = a * b;
  if (a < b) {
    temp = a;
    a = b;
    b = temp;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return x / b;
}
int main() {
  long long int n, ans = 0, Ans = 0;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0)
      ans = a[i];
    else {
      ans = bai(ans, a[i]);
    }
  }
  ans--;
  for (long long int i = 0; i < n; i++) {
    Ans += ans % a[i];
  }
  cout << Ans << endl;
  return 0;
}
