n, m = list(map(int, input().split())) if n==1 or m==1: print(m+n-2) else: print(m*n-1)