h,w=[int(e) for e in input().split()]
def f(h,w):
    F=[0]*(w+1)
    F[1]=1
    if w>=2:
        F[2]=4
    for i in range(3,w+1):
        F[i]=F[i-1]+i+1
    if h==1:
        return F[-1]
    if h==2:
        return 2*w+2*F[-1]
    G=[0]*(h+1)
    G[1]=F[-1]
    G[2]=2*w+2*F[-1]
    for i in range(3,h+1):
        G[i]=F[-1]+G[i-1]+w*i
    return G[-1]
print(max(f(h,w),f(w,h)))



'''
w=int(input())
F=[0]*(w+1)
F[1]=1
def f(x):
    return F[x]
for i in range(2,w+1):
    F[i]=i+max(f(j)+f(i-j) for j in range(1,i))
print(F)
'''



'''
h,w=[int(e) for e in input().split()]
F={}
def f(x,y):
    if max(x,y)==1:
        return 1
    if y<x:
        x,y=y,x
    if (x,y) in F.keys():
        return F[(x,y)]
    F[(x,y)]=x*y+f(x,y//2)+f(x,y-y//2)
    return F[(x,y)]
print(f(w,h))
'''
