n = int(eval(input()))

tmp = n*(n-1)

print((tmp//2))
n = int(eval(input()))

tmp = n*(n-1)

print((tmp/2))
n = int(eval(input()))
tmp = n * (n - 1)
print((tmp // 2))

n = int(eval(input()))
tmp = n * (n - 1)
print((tmp / 2))

-print((tmp // 2)) +print((tmp / 2))