#include #define rep(i, n)for(int i=0,i<(n);++i) using namespace std; using ll = long long; int dp[(1<<15)+5][5005]; int main(){ int n; cin >> n; vector a(n); for(int i = 0; i < n; i++) cin >> a[i]; dp[0][0] = 1; for(int i = 0; i < (1<<15); i++){ for(int j = 0; j < n; j++){ dp[i][j+1] = dp[i][j]; dp[i][j+1] += dp[i^a[j]][j]; } } int ans = 0; for(int i = 0; i < (1<<15); i++){ bool flag = false; for(int j = 1; j <= n; j++){ if(dp[i][j]>=1) flag = true; } if(flag) ans++; } cout << ans << endl; return 0; }