LearnPy Hub
← Arena
EasyRating 800

Gauss Sum

Print 1 + 2 + ... + n for a very large n. A loop is too slow; use the formula.

Input

One integer n (1 ≤ n ≤ 10¹⁸).

Output

The sum.

Sample 1

Input
10
Output
55

Sample 2

Input
1
Output
1
solution.py
Output appears here
Gauss Sum · Python Arena problem · LearnPy Hub