dnalen = int(input()); dnanum = int(input()); if dnalen == 3: print(dnanum); else: print(pow(2,dnalen-3)*dnanum);