//#include <tourist>
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;

typedef pair<ll, ll> p;
const int INF = 1e9;
const double eps = 1e-7;
const ll LINF = ll(1e18);
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
const long double pi = 4 * atan(1);
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &v)
{
    for (T &x : v)
        is >> x;
    return is;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
//g++ yarudake.cpp -std=c++17 -I .
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
//素数判定(O(√n))
bool is_prime(int n)
{
    for (int i = 2; i * i <= n; i++)
    {
        if (n % i == 0)
            return false;
    }
    return n != 1;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> x(n);
    cin >> x;
    vector<ll> y;
    for (int i = 2; i <= 50; i++)
    {
        if (is_prime(i))
            y.push_back(i);
    }
    ll ans = LINF;
    //cout << y.size() << "\n";
    rep(i, (1 << y.size()))
    {
        ll sum = 1;
        rep(j, y.size())
        {
            if ((1 << j) & i)
            {
                sum *= y[j];
            }
        }
        bool check = false;
        rep(j, n)
        {
            if (gcd(sum, x[j]) == 1)
            {
                check = true;
            }
        }
        if (!check)
            chmin(ans, sum);
    }
    cout << ans << "\n";
}

#include <bits/stdc++.h>
typedef long long ll;
#define ALL(l)  (l).begin(),(l).end()
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
using namespace std;

//const ll mod =  998244353;
//const ll maxn = 1000000000;

//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vll = vector<ll>; // long longの1次元の型に vll という別名をつける
using vvll = vector<vll>; // long longの2次元の型に vvll という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pll = pair<ll, ll>; // これ以降 pll という型名はpair<ll, ll> と同じ意味で使える
//---------------------------------------------------------------------------------------------------


int main() {
    ll ans=0;
  int h,w;
  cin>>h>>w;
    vi dx={-1,0,1,0};
   vi dy={0,-1,0,1};
  vvll a(h,vll(w));
  rep(i,h)rep(j,w){
      char s;
      cin>>s;
      if(s=='.')a.at(i).at(j)=0;
      else a.at(i).at(j)=1;
  }
  
  rep(i,h)rep(j,w){
      
      if(a.at(i).at(j)==1)continue;
      else{
          int nh,nw;
          rep(k,4){
              nh=i+dx.at(k);
              nw=j+dy.at(k);
              if(nh<0||nh>=h||nw<0||nw>=w)continue;
              else{
                  if(a.at(nh).at(nw)==0)ans++;
              }
          }
          a.at(i).at(j)=1;
      }
      
  }
  cout<<ans<<endl;
  //rep(i,h)rep(j,w)cout<<a.at(i).at(j);
}


