#include #include #include using namespace std; #define MAX_NUM 32769 int main() { bool dp[MAX_NUM] = {}, dp2[MAX_NUM] = {}; int N, a; cin >> N; dp[0] = 1; for (size_t i = 0; i < N; i++) { cin >> a; for (size_t j = 0; j < MAX_NUM; j++) { if (dp[j]) { dp2[a^j] = 1; } } for (size_t j = 0; j < MAX_NUM; j++) { dp[j] |= dp2[j]; } dp[a] = 1; } long long ans = 0; for (size_t i = 0; i < MAX_NUM; i++) { ans += dp[i]; } cout << ans << endl; }