#include <bits/stdc++.h>
using namespace std;
using vint = vector<int>;
using ll = long long;
using vll = vector<ll>;
template <class T>
void chmin(T& a, const T& b) {
  a = min(a, b);
}
template <class T>
void chmax(T& a, const T& b) {
  a = max(a, b);
}
void yes() {
  cout << "Yes" << endl;
  exit(0);
}
void no() {
  cout << "No" << endl;
  exit(0);
}
ll gcd(ll a, ll b) {
  ll r;
  while ((r = a % b) != 0) {
    a = b;
    b = r;
  }
  return b;
}
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
int main() {
  int n;
  cin >> n;
  vint a(n);
  for (int i = (0); i < (n); ++i) cin >> a[i];
  ll l = lcm(a[0], a[1]);
  for (int i = (2); i < (n); ++i) {
    l = lcm(l, a[i]);
  }
  l--;
  cerr << "l"
       << ": " << (l) << endl;
  ll ans = 0;
  for (int i = (0); i < (n); ++i) {
    ans += l % a[i];
  }
  cout << ans << endl;
  return 0;
}
