#include<bits/stdc++.h>
using namespace std;

vector<long long>graph[100'000];
long long answer=0;
bool used[100'005];
long long curr=0;
long long usedbits[205];
long long n;
long long br=0;

void dfs(long long x)
{
    if (x<=n) used[x]=true;
    else
    {
        usedbits[x-n]=curr;
        br++;
    }

    for (auto next:graph[x])
    {
        if (used[next] || usedbits[next-n]==curr) continue;

        dfs(next);
    }
}

int main ()
{
    cin>>n;
    long long a[n+10];
    for (long long i=1; i<=n; i++) cin>>a[i];

    for (long long i=1; i<=n; i++)
    {
        long long x=a[i];

        for (long long j=1; j<=205; j++)
        {
            if (x%2==1)
            {
                graph[i].push_back(n+j+1);
                graph[n+j+1].push_back(i);
            }
            x/=2;
        }
    }

    for (long long i=1; i<=n; i++)
    {
        if (used[i]) continue;
        br=0;
        curr++;
        dfs(i);

        answer=max(answer, br);
    }

    cout<<answer<<endl;
}
