def cutter(n,m): if(n==1): return m-1 elif(m==1): return n-1 elif(n>=m): if(n%2==1): return cutter(n/2+1,m) + cutter(n/2,m) else: return 2*cutter(n/2,m) else: if(m%2==1): return cutter(n,m/2+1) + cutter(n,m/2) else: return 2*cutter(n,m/2) #!/bin/python import sys n,m = raw_input().strip().split(' ') n,m = [int(n),int(m)] print (n-1)*m+m-1