#include <bits/stdc++.h>
#define task "triangles"
#define pb push_back
#define pll pair<ll, ll>
#define pii pair< pll, ll>
#define fi first
#define se second
using namespace std;
using ll = long long;
using ld = long double;

const int N = 2e5+5;
const ll mod = 1e5;
const ll ex = 1e5;

ll n, m, t, k, tong, a[N][5], b[N], T, ans, c[N], d[32][3], h[N], lo;
vector<ll> adj[N], kq;
string s, res;

bool check(ll x)
{
    memset(d, 0, sizeof(d));
    for(int i = 1; i <= n; i ++)
    {
        k = 0;
        for(int j = 0; j <= 4; j ++)
        {
            if(a[i][j] >= x)k |= (1<<j);
        }
        b[i] = k;
        d[k][0] = 1;
        //cout << b[i] <<" ";
    }
    for(int i = (1<<5)-1; i >= 0; i --)
    {
        for(int j = 0; j < 5; j ++)
        {
            if((i >> j) & 1)d[(i^(1<<j))][0] |= d[i][0];
        }
    }
    for(int l = 1; l <= 2;l  ++)
    {
        for(int i = (1<<5) - 1; i >= 0; i --)
        {
            for(int j = 1; j <= n ; j ++)
            {
                k = i ^ b[j];
                k = i & k;
                d[i][l] |= d[k][l-1];
            }
            for(int j = 0; j < 5; j ++)
            {
                if((i >> j) & 1)d[(i^(1<<j))][l] |= d[i][l];
            }
        }
    }
    return d[(1<<5)-1][2] == 1;
}
void sol()
{
    deque<char> q;
    cin >> s;
    for(int i = 0; i < s.length(); i ++)
    {
        char c = s[i];
        if(c == 'R')k ^= 1;
        else
        {
            if(k == 0)
            {
                q.pb(c);
            }
            else
            {
                q.push_front(c);
            }
        }
    }
    string res;
    //cout << k << " ";
    if(k == 0)
    {
        while(!q.empty())
        {
            if(!res.empty() && q.front() == res.back())
            {
                q.pop_front();
                res.pop_back();
                continue;
            }
            res += q.front();
            q.pop_front();
        }
    }
    else
    {
        while(!q.empty())
        {
            if(!res.empty() && q.back() == res.back())
            {
                q.pop_back();
                res.pop_back();
                continue;
            }
            res += q.back();
            q.pop_back();
        }
    }
    cout << res;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    if (fopen(task".in", "r"))
        freopen(task".in", "r", stdin),
            freopen(task".out", "w", stdout);

    int ntest = 1;
    //cin >> ntest;
    while(ntest -- > 0)
    sol();
}
/*
3 4
1 (
3 )
2 )
3 )

-1 0 1 0 -1
*/

#include <bits/stdc++.h>          
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define all(v) v.begin(), v.end()
void chmax(ll &x, ll y) {x = max(x,y);}
void chmin(ll &x, ll y) {x = min(x,y);}

void Yes() {cout << "Yes" << endl; exit(0);}
void No() {cout << "No" << endl; exit(0);}
void Cout(ll x) {cout << x << endl; exit(0);}

const ll inf = 1e18;

// 計算量(logN)
ll gcd(ll a, ll b) {
   if (a%b == 0) return b;
   else return gcd(b, a%b);
}

int main() {
    ll N; cin >> N;
    vector<ll> A(N);
    rep(i,N) cin >> A[i];

    ll L = inf;

    map<ll,ll> t;
    rep(i,N) {
        ll a = A[i];
        chmin(L,a);
        for (ll j=1; j*j<=a; j++) {
            if (a%j) continue;
            ll x = j, y = a/j;
            if (t[x]==0) t[x] = a;
            else t[x] = gcd(t[x],a);
            if (t[y]==0) t[y] = a;
            else t[y] = gcd(t[y],a);
        }
    }
    ll ans = 0;
    for (auto p : t) {
        ll x = p.first, y = p.second;
        if (x>L) break;
        if (x!=y) continue;
        ans++;
    }

    cout << ans << endl;
}