#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(int argc, const char* argv[]) {
  int n;
  cin >> n;
  vector<ll> v(n);
  ll x, y = 1;
  for (int i = 0; i < n; i++) {
    cin >> x;
    v[i] = x;
  }
  sort(v.begin(), v.end());
  ll pre = v[0];
  y = v[0];
  for (int i = 1; i < n; i++) {
    if (pre != v[i]) {
      y *= v[i];
    }
    pre = v[i];
  }
  ll sum = 0;
  for (int i = 0; i < n; i++) {
    sum += (y - 1) % v[i];
  }
  cout << sum << endl;
  return 0;
}
