#include <bits/stdc++.h>

using namespace std;

const int B = 18, MAX_N = (1 << 19) + 2;
int n, v[MAX_N];
int ap[B + 1];
bool can(int x)
{	for (int i = 0; i <= 18; ++i)
	{	if (x & (1 << i))
		{	if (!ap[i])
				return 0;
		}
	}

	return 1;

}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("data.in", "r", stdin);
	freopen("data.out", "w", stdout);
#endif // ONLINE_JUDGE

	scanf("%d", &n);

	for (int i = 1; i <= n; ++i)
		scanf("%d", &v[i]);

	sort(v + 1, v + n + 1);

	int nrm = n;

	for (int i = 1; i <= n; ++i)
	{	if (can(v[i]))
		{	nrm--;
		}
		else
			for (int j = 0; j <= 18; ++j)
			{	bool tst = (1 << j) & v[i];
				ap[j] |= tst;
			}
	}

	printf("%d", nrm);
	return 0;
}