Under construction

Still being built. Things may change

Building Pyramids

Time limit1sMemory limit1024 MB

Summary
Given n, the number of spheres on one edge of a tetrahedral stack, output the total number of spheres in the pyramid.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

At long last, the cats have finally set aside their squabbles with the coatis and the bees. They decide to build a monument to commemorate the end of their feud. To show that such different animals can live together in harmony, the Great Architect Principal Coati decides that this monument should consist of two completely different three-dimensional shapes: the triangular pyramid (for having very sharp corners) and the sphere (for having no corners at all). The idea is to create a large regular tetrahedron out of many small spheres, similar to the one shown in Figure B.1.

Figure B.1: A triangular pyramid of spheres, corresponding to the second sample input. One edge of the pyramid contains 55 spheres, so the entire pyramid consists of 3535 spheres.

Image CC BY-NC 2.0 by Amafirlian on Flickr

Alicia the coati, Beesworth the bee, and Darabella the cat would like this monument to be as large as possible. They have designated a piece of land to place the monument on, and have determined how many spheres should be in one of the edges based on where the monument will be placed. How many spheres will the entire pyramid contain, knowing the number of spheres in one of the edges?

Input

The first line contains one integer nn (1≤n≤1061\leq n\leq 10^6), the number of spheres in one of the edges of the pyramid.

Output

Output the number of spheres in the entire pyramid.

Examples3

  1. Example 1

    Input
    3
    
    Expected output
    10
    
  2. Example 2

    Input
    5
    
    Expected output
    35
    
  3. Example 3

    Input
    7777
    
    Expected output
    78424644529