#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll gcd(ll x, ll y) {
  if (x < y) swap(x, y);
  if (y == 0) return x;
  return gcd(y, x % y);
}
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  ll x = 1;
  for (int i = 0; i < N; i++) x = lcm(x, a[i]);
  x--;
  ll ans = 0;
  for (int i = 0; i < N; i++) ans += x % a[i];
  cout << ans << endl;
}
