#include <bits/stdc++.h>
using namespace std;
vector<int> vec;
int gcd(long long a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, int b) { return a * b / gcd(a, b); }
int f(long long m, int i) {
  if (i == 0) return m % vec[i];
  return f(m, i - 1) + m % vec[i];
}
int main() {
  int n;
  scanf("%d", &n);
  vec.resize(n);
  for (int i = 0; i < n; i++) scanf("%d", &vec[i]);
  long long lc = lcm(vec[0], vec[1]);
  for (int i = 2; i < vec.size(); i++) {
    lc = lcm(lc, vec[i]);
  }
  cout << f(lc - 1, n - 1);
  return 0;
}
