#include <bits/stdc++.h>
using namespace std;
int main(){
 int pass;
 int ans=0;
 string s;
  for(int i=0; i<10; i++){
  	cin >> s ;
  }

 for(int i=0; i<10000; i++){
    vector<int>a(10);
    pass=i;
 	for(int j=0; j<4; j++){
		
      	a.at(pass%10)=1;
        pass/=10;
          
          }	
   bool ok=true;
   for(int k=0; k<10; k++){
   	if(s[k]=='o' && a.at(k)!=1) ok=false;
    if(s[k]=='x' && a.at(k)!=0) ok=false;
   }
   if(ok) ans++;
 }
  cout << ans << endl;
}
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

map<int, int> mp;

void prime_factor(int x) {
  for (int i = 2; i * i <= x; i++) {
    if (x % i != 0) continue;
    while (x % i == 0) x /= i;
    mp[i]++;
  }
  if (x != 1) mp[x]++;
  return;
}

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];

  rep(i, n) prime_factor(a[i]);

  int ans = 0;
  int temp = 0;
  for (auto x : mp) {
    temp = max(temp, x.second);
    if (temp == x.second) ans = x.first;
  }
  
  cout << ans << endl;
  return 0;
}