#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
unsigned long long f(unsigned long long m,
                     const vector<unsigned long long>& A) {
  unsigned long long ret = 0;
  for (auto a : A) {
    ret += m % a;
  }
  return ret;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  vector<unsigned long long> A;
  unsigned long long N;
  cin >> N;
  for (unsigned long long i = 0; i < N; ++i) {
    unsigned long long tmp;
    cin >> tmp;
    A.push_back(tmp);
  }
  unsigned long long m = 1;
  for (auto a : A) {
    unsigned long long g = gcd(m, a);
    m = m * a / g;
  }
  cout << f(m - 1, A) << endl;
}
