#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007LL;
const double PI = 3.14159265358979;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
void solve() {
  int n;
  cin >> n;
  vector<ll> a(n);
  ll cm = 1;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    cm = lcm(cm, a[i]);
  }
  ll ans = 0;
  for (int i = 0; i < n; ++i) {
    ans += ((cm - 1) % a[i]);
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
  return 0;
}
