use std::collections::HashSet; fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let mut a = String::new(); std::io::stdin().read_line(&mut a).ok(); let a: HashSet = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let mut result: Vec = vec![false; 2usize.pow(15u32)]; let mut checked: HashSet = HashSet::new(); result[0] = true; checked.insert(0); for v in a.iter() { for i in checked.iter() { let val = v ^ i; result[val] = true; } checked = result.iter().enumerate().filter(|pair| *pair.1).map(|pair| pair.0).collect(); } println!("{}", result.iter().filter(|&&flg| flg).count()); }