n,m = map(int, input().strip().split())
length = max(n,m)
width = min(n,m)
print(width-1 + (length-1)*width)