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