#include <bits/stdc++.h>
using namespace std;
inline long long lcm(long long a, long long b) {
  if (a < b) swap(a, b);
  long long n = a, m = b;
  while (a % b != 0) {
    long long t = b;
    b = a % b;
    a = t;
  }
  return n / b * m;
}
signed main() {
  long long a;
  cin >> a;
  vector<long long> b(a);
  for (long long i = 0; i < a; i++) cin >> b.at(i);
  for (long long i = 0; i < a - 1; i++) {
    b.at(i + 1) = lcm(b.at(i), b.at(i + 1));
  }
  cout << b.at(-1) - 1 << endl;
}
