package main import ( "bufio" "os" "strconv" "math/rand" "fmt" "strings" ) func main() { N := nextInt() A := make([]int, N) for i := 0; i < N; i++ { A[i] = nextInt() } var dp = make([]bool, 16384+1) dp[0] = true for i := 0; i < N; i++ { var nextDP = make([]bool, 16384+1) for k := 0; k <= 16384; k++ { if dp[k] { nextDP[k] = true nextDP[k^A[i]] = true } } dp = nextDP } var sum = 0 for k := 0; k <= 16384; k++ { if dp[k] { sum++ } } PrintI(sum) } var s = bufio.NewScanner(os.Stdin) func next() string { s.Split(bufio.ScanWords) s.Scan() return s.Text() } func nextLine() string { s.Split(bufio.ScanLines) s.Scan() if nil != s.Err() { panic(s.Err()) } return s.Text() } func nextInt() int { i, e := strconv.Atoi(next()) if e != nil { panic(e) } return i } func randInt(a int , b int) int { return rand.Intn(b - a + 1) + a } func mapToString(arr []int) []string { ret := make([]string, len(arr)) for i := 0; i < len(arr); i++ { ret[i] = strconv.Itoa(arr[i]) } return ret } func PrintI(args ...int) { fmt.Println(strings.Join(mapToString(args), " ")) }