#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  ll mi = *min_element(a.begin(), a.end());
  ll ans = 1;
  for (ll i = 0; i < n; i++) {
    ans = ans * a[i];
  }
  ans--;
  ll res = 0;
  for (ll i = 0; i < n; i++) {
    res += ans % a[i];
  }
  cout << res << endl;
}
