def main(): n = input() x = 0 for a in map(int, input().split()): x |= a print(2 ** bin(x)[2:].count('1')) if __name__ == '__main__': main()