#include <bits/stdc++.h>
using namespace std;
int gcd(long long x, long long y);
int lcm(long long x, long long y);
int main(void) {
  int n;
  cin >> n;
  int su[n];
  long long saidai, ans;
  for (int i = 0; i < n; i++) {
    cin >> su[i];
  }
  saidai = su[0];
  for (int i = 0; i < n; i++) {
    saidai = lcm(saidai, su[i]);
  }
  saidai--;
  for (int i = 0; i < n; i++) {
    ans += (saidai % su[i]);
  }
  cout << ans << endl;
  return 0;
}
int gcd(long long x, long long y) {
  long long r;
  while ((r = x % y) != 0) {
    x = y;
    y = r;
  }
  return y;
}
int lcm(long long x, long long y) { return (x * y / gcd(x, y)); }
