n, m = [int(i) for i in input().split()] op = 0 if (n > 1 and m > 1): op = int((n - 1)*n/2 + (m - 2)*(m-1)/2) print(op)