#include <bits/stdc++.h>
#include <string>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

/* pow(x,n)はx^nを返すよ! */
ull pow(ull x,ull n) {
   ull res = 1;
   while(n > 0) {
      if(n&1) res = res * x;
      x = x * x;
      n >>= 1;
   }
   return res;
}

int main() {
  int i,j,k;
  int n;
  int a,cnt5=0,cnt2=0;
  cin >> n;
  for(i=0;i<n;i++) {
	cin >> a;
	int tmp5=2,tmp2=2;
	while(a % 5 == 0) {
	  tmp5--;
	  a /= 5;
	}
	
	while(a % 2 == 0) {
	  tmp2--;
	  a /= 2;
	}
	if(cnt5 < tmp5) cnt5 = tmp5;
	if(cnt2 < tmp2) cnt2 = tmp2;
  }
  int rep = 1;
  for(i=0;i<cnt2;i++) rep *= 2;
  for(i=0;i<cnt5;i++) rep *= 5;
  cout << rep << endl;
  return 0;
}