n, m = list(map(int, input().split())) a = min(n,m) b = max(n,m) print(a - 1 + a*(b-1))