Skip to content

Sum of 1…N

A1300
English

Language

Contribute a translation
Time limit
1000 ms
Memory limit
256 MB
Submissions
1
Correct
1
Solved by
1
AC rate
100.000%

Statement

Given a natural number $N$, find the sum of the first $N$ natural numbers.

Input

The first line contains a positive integer $N$. ($1 \le N \le 1\,000$)

Output

Print the sum of the first $N$ natural numbers.

Examples

Sample input 1
5
Sample output 1
15

$1+2+3+4+5=15$

Sample input 2
100
Sample output 2
5050

$1 + 2 + \cdots + 99 + 100 = 5050$

Tags

No tags yet

In these problemsets