import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines x,y = map(int,read().split()) ev_x = x%2 == 0 ev_y = y%2 == 0 if ev_x and ev_y: answer = (x+1) * (y+1) - max(x,y) if x == y: answer -= 1 elif ev_x and (not ev_y): answer = (x+1) * (y+1) - y elif (not ev_x) and ev_y: answer = (x+1) * (y+1) - x else: answer = (x+1) * (y+1) - min(x,y) if x == 0: answer = 1 if y == 0: answer = 1 if x + y == 0: answer = 0 print(answer)