n,m = input().strip().split(' ') x = int(n) - 1 y = int(n) * (int(m)-1) print (x + y)