~/algor $ cat problems/kombinatorika-uch-rangli-bayroq
Three-stripe flags
Easy
1000 ms
128 MB
25%
A flag consists of three horizontal stripes. Each stripe is painted in one of $k$ colors; adjacent stripes must have different colors, while the top and bottom stripes may have the same color. How many different flags can be made?
Input
One positive integer $k$.
Output
One integer — the number of flags.
Note
$1 \le k \le 10^{6}$
Examples
Input #1
3
Output #1
12
Input #2
1
Output #2
0