from itertools import combinations, product N,M = list(map(int,input().split())) def naive(N,M): ret = 0 for i in product(range(M+1),repeat=N): tmp = 0 for j in i: tmp ^= j if(tmp != 0):continue ret = max(ret, sum(i)) return ret def solve(N,M): if(N == 1): return 0 elif(N%2 == 0): return M*N else: # のこりの3つで最大化 A = [0,0,0] for i in range(30,-1,-1): if(A[1] + (1< M):continue A[0] += 1<