# Enter your code here. Read input from STDIN. Print output to STDOUT inputs = $stdin.read.split() n = inputs[0].to_i m = inputs[1].to_i def num_cuts(n,m) paper_size = n*m num_cuts = paper_size - 1 return num_cuts #inputs.class end print num_cuts(n,m)