In _K-city_ , there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city?
n, m = map(int, input().split())
x = (n - 2) + (m - 2)
ans = 1
for i in range(x):
  ans *= 2
print(ans)
n, m = map(int, input().split())
x = (n - 1) * (m - 1)
print(x)