#include <bits/stdc++.h>
int fgcd(int a, int b);
int flcm(int a, int b);
int flcm2(int *p, int n);
int main(void) {
  int n, i, lcm;
  int *p;
  scanf("%d", &n);
  p = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++) scanf("%d", p + i);
  lcm = flcm2(p, n);
  printf("%d\n", lcm - 1);
  return 0;
}
int fgcd(int a, int b) {
  int r;
  while ((r = a % b) != 0) {
    a = b;
    b = r;
  }
  return b;
}
int flcm(int a, int b) { return a * b / fgcd(a, b); }
int flcm2(int *p, int n) {
  if (n == 2)
    return flcm(*p, *(p + 1));
  else {
    *(p + n - 2) = flcm(*(p + n - 2), *(p + n - 1));
    return (flcm2(p, n - 1));
  }
}
