n, m = map(int, input().split())
if n == m == 1:
    print(1)
elif n == m and n%2==0 and m % 2 == 0:
    print(m*n*(n+1))
elif n == m and n%2!=0 and m % 2 != 0:
    print(m*n*(n+1) + 3)
else:
    print(n*m*(max(n,m)+1)+8)
    