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