#include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define rep(i,b) for(ll i=0;i<(b);++i) #define rep1(i,b) for(ll i=1;i<=(b);++i) #define vec vector #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl; int N; int A[5010]; int dp[(1 << 16)]; int main() { cin >> N; rep1(i, N) { scanf("%d", &A[i]); dp[A[i]] = 1; } for (int i=0;i<=N;i++) { for (int j=(1 << 15);j>=0;j--) { dp[j ^ A[i]] |= dp[j] & dp[A[i]]; } } int ans = 0; rep(i, (1 << 16)+1) { ans += dp[i]; } cout << ans << endl; }