import sugar, strutils, sets proc nextString: string = result = "" while not endOfFile stdin: let nextChar = readChar stdin case nextChar of '\r': discard of "\n"[0], ' ': break else: add result, nextChar proc nextInt: int = parseInt nextString() let n = nextInt() A = lc[nextInt() | (i <- 0 ..< n), int] var B = [0].toSet proc main: void = for j in 0 ..< 2: for i in 0 ..< n: for b in B: incl B, A[i] xor b echo B.len when isMainModule: main()