#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int gcd(int a, int b) {
  for (;;) {
    if (a == 0) return b;
    b %= a;
    if (b == 0) return a;
    a %= b;
  }
}
int lcm(int a, int b) {
  int temp = gcd(a, b);
  return temp ? (a / temp * b) : 0;
}
int main() {
  int N;
  cin >> N;
  vector<long long> a(N);
  for (long long i = 0; i < (long long)N; i++) cin >> a[i];
  long long result = std::accumulate(a.begin(), a.end(), 1, lcm) - 1;
  long long ans = 0;
  for (long long i = 0; i < (long long)N; i++) ans += result % a[i];
  std::cout << ans << '\n';
}
