#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  int t;
  while (b != 0) {
    t = a % b;
    a = b;
    b = t;
  }
  return a;
}
int mul(int a, int b) { return a / gcd(a, b) * b; }
const int maxn = 100005;
int a[maxn];
long long ans = 1, res = 0;
int n;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) ans = mul(ans, a[i]);
  ans -= 1;
  for (int i = 0; i < n; i++) res += ans % a[i];
  cout << res;
}
