#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long q1 = min(a, b), q2 = max(a, b);
  a = q1, b = q2;
  return (a * (b / (gcd(a, b))));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, ans;
  cin >> n;
  long long x[n];
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
    if (i == 0)
      ans = x[i];
    else
      ans = lcm(ans, x[i]);
  }
  ans--;
  long long yeah = 0;
  for (long long i = 0; i < n; i++) {
    yeah += (ans % x[i]);
  }
  cout << yeah;
  return 0;
}
