#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
long long f(long long x, vector<long long> a) {
  int rsl = 0;
  for (int i = (int)0; i < (int)a.size(); i++) rsl += (x % a[i]);
  return rsl;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<long long> a(N);
  for (int i = (int)0; i < (int)N; i++) cin >> a[i];
  long long tmp = a[0];
  for (int i = (int)1; i < (int)a.size(); i++) tmp = lcm(tmp, a[i]);
  cout << f(tmp - 1, a) << endl;
}
