#include <iostream>
#include <bitset>

using namespace std;

const int NMAX = 1 << 19;
const int INF = 1 << 30;

int n;
int res = INF;

int s[1 + NMAX];

bitset < 1 + NMAX > vis;

int main()
{
  ios::sync_with_stdio(false);

  cin >> n;
  res = n;

  for(int i = 1; i <= n; i++) {
    int x;
    cin >> x;

    vis[x] = 1;
  }

  for(int i = 1; i <= NMAX; i++) {
    for(int j = 0; j <= 19; j++) {
      if(i & (1 << j)) {
        s[i] |= s[i - (1 << j)];
      }
    }

    if(vis[i] == 1 && s[i] == i)
      res--;
    if(vis[i] == 1)
      s[i] = i;
  }

  cout << res << '\n';

  return 0;
}