#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }
  return b ? gcd(b, a % b) : a;
}
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
int main() {
  int N;
  cin >> N;
  vector<ll> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  ll ha = 1;
  for (int i = 0; i < N; i++) {
    ha = lcm(ha, A.at(i));
  }
  ll ans = 0;
  ll waru = ha - 1;
  for (int i = 0; i < N; i++) {
    ans += waru % A.at(i);
  }
  cout << ans << endl;
  ;
}
