Write a program that reads a natural number n, and prints the result of the following sum:
1^{2} + 2^{2} + … + (n−1)^{2} + n^{2} . |
Input
Input consists of a natural number n.
Output
Print the sum of the first n squares: ∑_{i=1}^{n} i^{2}.
Observation
The summation has a closed formula, so a loop would not be necessary to solve this exercise.
Input
3
Output
14
Input
4
Output
30