#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
using namespace std;
//cout << fixed << setprecision(0)

int gcd(int a,b){
  if(b==0)return a;
  return gcd(b,a%b);
}

int lcm(int a,b){
  return a*b/gcd(a,b);
}

int main() { 
  int n;cin >> n;
  int ans,pre,now;
  cin >> pre >> now;
  ans = lcm(pre,now);
  rep(i,n-2){
    pre = now;
    cin >> now;
    ans = lcm(now,ans);
  }
  cout << ans-1 << endl;
}
