using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long sumOfGroup(int k) { // Return the sum of the elements of the k'th group. long first = 0,total = 0; first = k * (k - 1) + 1; total = first + next(first,1,k); return total; } static long next(long f, long i, long k) { if(i == (k-1)) return f + 2*i; else return f + (2 * i) + next(f,i+1,k); } static void Main(String[] args) { int k = Convert.ToInt32(Console.ReadLine()); long answer = sumOfGroup(k); Console.WriteLine(answer); } }