W, H = map(int, input().split()) if W == 0 or H == 0: if W == 0 and H == 0: print(0) else: print(max(W, H)) else: if W >= H: print(W * H + (W + H - 2)) else: print(W * H + W + 1)