#include <bits/stdc++.h>
using namespace std;
vector<unsigned long long> a;
unsigned long long gcd(unsigned long long m, unsigned long long n) {
  if ((0 == m) || (0 == n)) return 0;
  while (m != n) {
    if (m > n)
      m = m - n;
    else
      n = n - m;
  }
  return m;
}
unsigned long long lcm(unsigned long long m, unsigned long long n) {
  if ((0 == m) || (0 == n)) return 0;
  return ((m / gcd(m, n)) * n);
}
int main() {
  unsigned long long n = 0;
  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 lcm_num = lcm(a.at(0), a.at(1));
  for (unsigned long long j = 2; j < n; ++j) {
    lcm_num = lcm(lcm_num, a.at(j));
  }
  unsigned long long m = lcm_num - 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;
}
