All problems

Sum of Natural Numbers up to N

easyPythonMathLoops

A charity walk numbers its checkpoints 1, 2, 3 and so on along the route. A checkpoint awards points equal to its own number, and a walker who reaches checkpoint n has passed through every checkpoint below it on the way. The scoreboard shows a walker's points the moment they arrive at checkpoint n.

Task: Print the total awarded by every checkpoint from 1 up to n.

Input

A single line holding one integer n, with 1 ≤ n ≤ 1,000,000.

Output

One line holding a single integer — the total. It must be printed as a whole number, with no decimal point.

Example:

Input:
10

Output:
55

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…