# Enter your code here. Read input from STDIN. Print output to STDOUT dimensions = gets.split(' ') x = dimensions[0].to_i y = dimensions[1].to_i x_cuts = x-1 y_cuts = (y-1)*x print x_cuts + y_cuts