#include <bits/stdc++.h>
using namespace std;
unsigned long long gcm(unsigned long long a, unsigned long long b) {
  unsigned long long result = a;
  unsigned long long k = 0;
  unsigned long long n = b;
  do {
    k = result % n;
    result = n;
    n = k;
  } while (k != 0);
  return result;
}
unsigned long long lcm(unsigned long long a, unsigned long long b) {
  unsigned long long g;
  g = gcm(a, b);
  return a * b / g;
}
unsigned long long lcm_n(vector<unsigned long long> &numbers) {
  unsigned long long l;
  l = numbers[0];
  for (unsigned long long i = 1; i < numbers.size(); i++) {
    l = lcm(l, numbers[i]);
  }
  return l;
}
int main() {
  unsigned long long N, m = 0;
  cin >> N;
  vector<unsigned long long> v(N);
  for (unsigned long long i = 0; i < N; i++) {
    cin >> v.at(i);
  }
  m = lcm_n(v) - 1;
  unsigned long long sum = 0;
  for (auto it = v.begin(); it != v.end(); ++it) {
    sum += m % (*it);
  }
  cout << sum << endl;
  return 0;
}
