#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a >= b) {
    long long q0 = a;
    long long q1 = b;
    while (q0 % q1 != 0) {
      long long tmp = q1;
      q1 = q0;
      q0 = tmp % q0;
    }
    return q1;
  } else
    gcd(b, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long lcm_vec(vector<long long> A) {
  long long res = 1;
  int n = A.size();
  for (int i = 0; i < (n); i++) {
    res = lcm(res, A[i]);
  }
  return res;
}
long long f(long long m, vector<long long> a) {
  int N = a.size();
  long long sum = 0;
  for (int i = 0; i < (N); i++) sum += m % a[i];
  return sum;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<long long> a(N);
  for (int i = 0; i < (N); i++) cin >> a[i];
  long long m = lcm_vec(a) - 1;
  cout << f(m, a) << "\n";
  return 0;
}
