#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll c, ll d) { return c * d / gcd(c, d); }
int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) cin >> a.at(i);
  ll res = a.at(0);
  for (int i = 1; i < n; i++) {
    res = lcm(res, a.at(i));
  }
  res--;
  ll sum = 0;
  for (int i = 0; i < n; i++) {
    sum += res % a.at(i);
  }
  cout << sum << endl;
}
