n = gets.to_i as = gets.strip.split.map { |e| e.to_i} MAX = 32768 dp = Array.new(MAX, false) nex = Array.new(MAX, false) dp[0] = true as.each{|i| MAX.times{|j| if dp[j] num = j ^ i nex[num] = true end nex[j] |= dp[j] } MAX.times{|j| dp[j] = nex[j] } } cnt = dp.count{|i| i} puts cnt