# Enter your code here. Read input from STDIN. Print output to STDOUT n, m = STDIN.gets.strip.split(" ").map(&:to_i) puts (n-1) + n * (m-1)