fn main() { let stdin = std::io::read_to_string(std::io::stdin().lock()).unwrap(); let mut stdin = stdin.split_ascii_whitespace(); let n: usize = stdin.next().unwrap().parse().unwrap(); let a: Vec = (0..n) .map(|_| stdin.next().unwrap().parse().unwrap()) .collect(); use std::io::Write; std::io::stdout() .lock() .write_all(output(solve(a)).as_bytes()) .unwrap(); } fn solve(a: Vec) -> usize { let n = a.len(); let mut dp = [[false; 1 << 15]; 2]; dp[0][0] = true; a.into_iter().enumerate().for_each(|(i, a)| { for j in 0..dp[(i & 1) ^ 1].len() { dp[(i & 1) ^ 1][j] = dp[i & 1][j] || dp[i & 1][j ^ a as usize]; } }); dp[n & 1].into_iter().filter(|&d| d).count() } fn output(ans: usize) -> String { ans.to_string() + "\n" }