m = list(map(lambda x:int(x), input().split())) horCuts = m[0] - 1 vertCuts = m[0] * (m [1] - 1); print(sum([horCuts , vertCuts]))