/*NEVER GIVE UP*/
/*First try brute force and check if it is in the range of time complexity*/
/*Then try to solve the problem in mathematical form*/
/*Then try to imagine how the final ans will look like*/
/*Write on paper if still not able to get*/
/*Try to think diff. algorithms and data structures that could solve the problem*/
#include <bits/stdc++.h>
using namespace std;
int main()
{long long n=0,max=0,max1=0,temp=0,temp1=0;
    cin>>n;
    long long a[1<<n];
    for(long long j=0;j<(1<<n);j++)
    cin>>a[j];
    for(long long j=0;j<(1<<n)/2;j++)
    {
        if(a[j]>max)
        {
            max=a[j];
            temp=j;
        }
    }
    for(long long j=(1<<n)/2;j<(1<<n);j++)
    {
        if(a[j]>max1)
        {
            max1=a[j];
            temp1=j;
        }
    }
    if(max<max1)
    cout<<temp+1;
    else
    cout<<temp1+1;
    
}
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for(int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("Yes");}else{puts("No");}
#define MAX_N 200005

int GCD(int x, int y){
    if(x == 0 && y == 0) return 0;
    if(x>y){
        int swap = x;
        x = y;
        y = swap;
    }
    while(true){
        if(y%x==0){
            return x;
        }else{
            int amari = y%x;
            y = x;
            x = amari;
        }
    }
}

vector<ll> yakusuu_rekkyo(ll n){
    vector<ll> divisors;
    for(ll i = 1; i <= n; i++){
        if(i * i > n)break;
        if(i * i == n){
            divisors.push_back(i);
            break;
        }else if(n % i == 0){
            divisors.push_back(i);
            divisors.push_back(n/i);
        }   
    }
    sort(divisors.begin(), divisors.end());
    return divisors;
}


int main() {
    int n; cin >> n;
    int a[n] = {};
    rep(i,n) cin >> a[i];
    sort(a,a+n);

    set<int> se;
    rep(i,n){
        vector<ll> v = yakusuu_rekkyo(a[i]);
        rep(j,v.size()) se.insert(v[j]);
    }

    int ans = 0;
    for(auto x: se){
        if(x > a[0]) continue;
        int now = -1;
        rep(i,n){
            if(a[i] % x == 0){
                if(now == -1){
                    now = a[i];
                }else{
                    now = GCD(now, a[i]);
                }
            }
        }
        if(now == x) ans++;
    }

    cout << ans << endl;
    return 0;
}


