#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long requiredNum = 1;
  for (long long i = 0; i < n; i++) {
    requiredNum = lcm(requiredNum, a[i]);
  }
  requiredNum--;
  long long result = 0;
  for (long long i = 0; i < n; i++) {
    result += requiredNum % a[i];
  }
  cout << result;
  return 0;
}
