n,m=[int(i) for i in input().split()] if(m!=1 and n!=1): print(n-1+(n*(m-1))) else: if(n==1): print(m-1) else: print(n-1)