using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static long sumOfGroup(long k) { // Return the sum of the elements of the k'th group. long n = (k-1) * k / 2; long sum = 0; for (long i = 0; i < k; i++) { sum += (2 * (n + i)) + 1; //2n + 1 } return sum; } static void Main(String[] args) { long k = Convert.ToInt64(Console.ReadLine()); long answer = sumOfGroup(k); Console.WriteLine(answer); } }