Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/for-qoshni-sonlar-kopaytmalari

Products of neighbours

Easy 1000 ms 64 MB 25%
Share

A positive integer $n$ is given. Compute the sum:

$$S = 1 * 2 + 2 * 3 + 3 * 4 + \dots + n * (n + 1)$$

The sum of products of neighbouring numbers

Input

One positive integer $n$.

Output

One integer — $S$.

Note

$1 \le n \le 10^{5}$

Examples

Input #1
3
Output #1
20
Input #2
5
Output #2
70

Sign in to submit a solution

Signing up is free and takes a minute.