m = int(input())
n = int(input())
p = 0
if m==1 or n==1:
p=0
elif m==2 or n==2:
p = 2
elif m >= 3 and n >= 3:
p = 4
m-=2
n-=2
while m > 1 and n > 1:
if m >= 3 and n >= 3:
m-=2
n-=2
p+=4
elif m==2 or n==2:
m-=2
n-=2
p+=2
else:
p+=1
print(p)