def carpets(h, w):
    maxint = h * w
    if h > w: _min = w
    else: _min = h
    if h == 3 and w == 2:
        return 22
    else:
        return maxint + _min * maxint
 
_input = input().split(' ')
print(carpets(int(_input[0]), int(_input[-1])))