# Enter your code here. Read input from STDIN. Print output to STDOUT n, m = raw_input().split() n = int(n) m = int(m) cuts = (n-1) + (n * (m - 1)) print cuts