def nCuts(m,n): if n > m: m,n=n,m return n-1+n*(m-1) if __name__=="__main__": import sys m,n = map(int,sys.stdin.read().strip().split(" ")) print(nCuts(m,n))