#include <bits/stdc++.h>
using namespace std;
constexpr long long gcd(long long a, long long b) {
  return b ? gcd(b, a % b) : a;
}
constexpr long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long cumlcm = 1;
  for (auto &&i : a) {
    cumlcm = lcm(i, cumlcm);
  }
  const long long m = cumlcm - 1;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    ans += m % a[i];
  }
  cout << ans << endl;
}
