#include "bits/stdc++.h"
using namespace std;
const int N = 1 << 20;
const int LN = 20;
const int mod1 = 1e9 + 7;
const int mod2 = 1e9 + 9;
int n;
int cnt[N];
int pw1[N];
int pw2[N];
int dp[N][2];
int res1[N];
int res2[N];
void sosdp(){
for(int i = 0 ; i < N ; ++i){
dp[i][0] = cnt[i];
}
for(int j = 0 ; j < LN ; ++j){
for(int i = 0 ; i < N ; ++i){
if(!((i >> j) & 1)){
dp[i][0] += dp[i | (1 << j)][0];
}
}
}
for(int i = 0 ; i < N ; ++i){
res1[i] = pw1[dp[i][0]] - 1;
res2[i] = pw2[dp[i][0]] - 1;
}
}
void inversesosdp(){
for(int i = 0 ; i < N ; ++i){
dp[i][0] = res1[i];
dp[i][1] = res2[i];
}
for(int j = 0 ; j < LN ; ++j){
for(int i = 0 ; i < N ; ++i){
if(!((i >> j) & 1)){
dp[i][0] -= dp[i | (1 << j)][0];
dp[i][1] -= dp[i | (1 << j)][1];
dp[i][0] += (dp[i][0] < 0) * mod1;
dp[i][1] += (dp[i][1] < 0) * mod2;
}
}
}
for(int i = 0 ; i < N ; ++i){
res1[i] = dp[i][0];
res2[i] = dp[i][1];
}
}
int main(){
scanf("%d" , &n);
while(n--){
int inp;
scanf("%d" , &inp);
cnt[inp] = 1;
}
pw1[0] = 1;
pw2[0] = 1;
for(int i = 1 ; i < N ; ++i){
pw1[i] = (pw1[i - 1] * 2) % mod1;
pw2[i] = (pw2[i - 1] * 2) % mod2;
}
sosdp();
inversesosdp();
int ans = 1;
for(int i = 1 ; i < N ; ++i){
ans += (res1[i] && res2[i]);
}
printf("%d\n" , ans);
}