import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long firstElement(int k) { if (k ==1){ return 1; } else { return k-1 + firstElement(k-1); } } static long sumOfGroup(int k) { /*long temp = 0; for (int j = 1; j<=k; j++){ temp +=j; }*/ //long firstElem = (k+k-1-1)*2+1; //System.out.println(firstElement(k)); long firstElem = (firstElement(k)-1)*2+1; long count = firstElem; for (int i = 1; i < k; i++) { count += firstElem +i*2; } return count; // Return the sum of the elements of the k'th group. } public static void main(String[] args) { Scanner in = new Scanner(System.in); int k = in.nextInt(); long answer = sumOfGroup(k); System.out.println(answer); in.close(); } }