#include <bits/stdc++.h>

using namespace std;

typedef long long LL;

const int nmax = 1000010; const LL mod = 1000003;

int N,a[nmax],ans,bit[25];

int main(void){
   int i,j,aux,x;
//   freopen("txt.in","r",stdin);
//   freopen("txt.out","w",stdout);
   ios::sync_with_stdio(false);
   cin >> N;
   for(i = 1; i <= N; ++i)
      cin >> a[i];
   ans = N;
   sort(a+1,a+N+1);
   for(i = 1; i <= N; ++i){
      aux = a[i];
      j=0;
      bool ok = true;
      while(aux){
         x=aux%2;
         if(!bit[j] && x){
               ok = false;
               break;
         }
         aux/=2;
         ++j;
      }
      if(ok)--ans;
      else{
         aux = a[i];
         j=0;
         while(aux){
            bit[j] = max(bit[j],aux%2);
            ++j;
            aux/=2;
      }
      }
   }
   cout << ans << '\n';
    return 0;
}