#include <bits/stdc++.h>
using namespace std;
const int h1[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int h2[8] = {0, 1, 1, 1, 0, -1, -1, -1};
long long dai(long long a, long long b) { return max(a, b); }
long long syo(long long a, long long b) { return min(a, b); }
long long n;
vector<long long> a(3010);
long long daikou, daikou2, syokou;
long long kai = 0;
long long koudai(long long a, long long b) {
  if (b == 0)
    daikou = a;
  else
    daikou = koudai(b, a % b);
  return daikou;
}
long long kousyo(long long a, long long b, long long c) {
  syokou = a * b / c;
  return syokou;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  for (long long j = 0; j < long long(n); ++j) {
    cin >> a[j];
  }
  daikou = 1;
  syokou = 1;
  for (long long j = 0; j < long long(n); ++j) {
    daikou = koudai(daikou, a[j]);
    daikou2 = koudai(syokou, a[j]);
    syokou = kousyo(syokou, a[j], daikou2);
  }
  for (long long j = 0; j < long long(syokou); ++j) {
    long long wa = 0;
    for (long long k = 0; k < long long(n); ++k) {
      wa += j % a[k];
    }
    kai = dai(kai, wa);
  }
  cout << kai << endl;
  return 0;
}
