Sum of First N IntegersEasy

Sum of First N Integers

EasyPractice library · +10 XPbinary searcharithmetic series

Given a positive integer N, calculate the sum of all positive integers from 1 up to N, inclusive. That is, compute 1 + 2 + 3 + ... + N.

Input

A single line containing the integer N.

Output

A single line containing the sum 1 + 2 + ... + N.

Constraints

1 <= N <= 1000

Time limit 1 s (native code; slower languages get more)Memory 256 MB12 hidden tests

Example 1

Input
5
Output
15

The sum is 1 + 2 + 3 + 4 + 5 = 15.

Example 2

Input
10
Output
55

The sum is 1 + 2 + ... + 10 = 55.

Hints