#include <bits/stdc++.h>
using namespace std;
unsigned long long gcm(long a, 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;
}
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(void) {
  unsigned long long n;
  vector<unsigned long long> a;
  cin >> n;
  for (unsigned long long i = 0; i < n; ++i) {
    unsigned long long tmp = 0;
    cin >> tmp;
    a.push_back(tmp);
  }
  unsigned long long m = lcm_n(a) - 1;
  unsigned long long ans = 0;
  for (unsigned long long j = 0; j < n; ++j) {
    ans = ans + m % a.at(j);
  }
  cout << ans << endl;
  return 0;
}
