from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N, M = map(int, input().split())

    x = 1
    for i in range(1, M + 1):
        if i % 3:
            x *= 2
    print(x * N)


main()
