import sys t = input().split() m= int(t[0]) n=int(t[1]) if m>n: total = (n-1)+((m-1)*n) else: total = (m-1)+((n-1)*m) print(total)