#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) {
  if (b > a) swap(a, b);
  ll r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int main() {
  int n;
  ll gld;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < (int)(n); i++) {
    ll num;
    cin >> num;
    a[i] = num;
    if (i == 0)
      gld = num;
    else {
      gld = gld * num / gcd(gld, num);
    }
  }
  ll ans = 0;
  for (int i = 0; i < (int)(n); i++) ans += (gld - 1) % a[i];
  cout << ans << endl;
  return 0;
}
