print((sum([i for i in range(1,int(eval(input()))+1)])))
n=int(eval(input()));print(((n*(n+1))//2))
print((sum([i for i in range(1, int(eval(input())) + 1)])))

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

-print((sum([i for i in range(1, int(eval(input())) + 1)]))) +n = int(eval(input())) +print(((n * (n + 1)) // 2))