Hive
Time limit2sMemory limit1024 MB
Given the size n of a hexagonal hive built from rings around one center cell, print the total number of cells.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Statement
Kevin works as a builder. Since Kevin is a bee, he builds only beehives.
A beehive is made of identical cells, each one a regular hexagon. Among bees, a hive of size one is a hive made of a single cell. A hive of size two is a hive of size one surrounded by one ring of cells. In general, a hive of size is a hive of size surrounded by a ring of cells.

Recently Kevin was asked to build a hive of size . To plan the work, he needs the exact number of cells in the hive. Write a program that takes the size and prints the number of cells in that hive.
Input
The input file contains a single integer (), the size of the hive.
Output
Print a single number, the number of cells in the hive.