#include <bits/stdc++.h>
using namespace std;
long gcf(long a, long b) {
  if (b == 0) return a;
  return gcf(b, a % b);
}
long lcm(long a, long b) {
  long g = gcf(a, b);
  return a / g * b;
}
int main() {
  long N;
  cin >> N;
  long lcm1 = 1;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
    lcm1 = lcm(lcm1, a.at(i));
  }
  long ans = 0;
  for (int i = 0; i < N; i++) {
    ans += (lcm1 - 1) % a.at(i);
  }
  cout << ans << endl;
}
