n, m = map(int,input().split()) if n == 1: print(m-1) elif m == 1: print(n-1) else: area=n*m print(area-1)