#include using namespace std; typedef unsigned long long ull; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair pdd; const ull mod = 1e9 + 7; #define REP(i,n) for(int i=0;i<(int)n;++i) //debug #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; template ostream& operator << (ostream& os, const pair v){ os << "(" << v.first << ", " << v.second << ")"; return os; } template ostream& operator << (ostream& os, const vector v){ for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os; } template ostream& operator << (ostream& os, const vector> v){ for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os; } map prime_factorization(ll x){ map mp; bool flag = true; while(flag){ ll sqx = sqrt(x)+1; for(ll j=2;j> N; vector A(N); REP(i, N) cin >> A[i]; vector B(N); REP(i, N){ ll tmp = 1; auto mp = prime_factorization(A[i]); for(auto x: mp){ tmp *= x.first; } B[i] = tmp; } map mp[55]; mp[0][0] = 1; REP(i, N){ for(auto x:mp[i]){ ll val = x.first; ll cnt = x.second; mp[i+1][val] += cnt; mp[i+1][Euclid(val, A[i])] += cnt; } } cout << mp[N][1] << endl; return 0; }