#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000;
const long long MOD = (long long)1e9 + 7;
template <class T>
inline T in() {
  T x;
  cin >> x;
  return x;
}
vector<long long> v;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm() {
  long long d = v[0];
  for (long long i = 1; i < v.size(); i++) {
    d = gcd(d, v[i]);
  }
  long long m = 1;
  for (long long i = 0; i < v.size(); i++) {
    m *= v[i] / d;
  }
  return m;
}
signed main() {
  long long n = in<long long>();
  for (long long i = 0; i < n; i++) {
    long long x = in<long long>();
    v.push_back(x);
  }
  long long m = lcm() - 1;
  long long r = 0;
  for (long long i = 0; i < n; i++) {
    r += m % v[i];
  }
  cout << r << "\n";
}
