a = list(map(int, input().strip().split(" "))) m = a[0] n = a[1] count = 0 for i in range(1,m): count += 1 for j in range(1,n): count += 1 print(count)