#include <bits/stdc++.h>
using namespace std;
vector<unsigned long long> a;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  if (a < b) {
    return gcd(b, a);
  }
  while (b != 0) {
    unsigned long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}
unsigned long long solve(unsigned long long m) {
  unsigned long long res = 0;
  for (int i = 0; i < a.size(); i++) {
    res += m % a[i];
  }
  return res;
}
int main(void) {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int val;
    cin >> val;
    a.push_back(val);
  }
  unsigned long long lcm = a[0] * (a[1] / gcd(a[0], a[1]));
  for (int i = 2; i < n; i++) {
    lcm = lcm * (a[i] / gcd(lcm, a[i]));
  }
  unsigned long long ans;
  ans = solve(lcm - 1);
  cout << ans << endl;
}
