import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long sumOfGroup(int k) { // Return the sum of the elements of the k'th group. int start = 0; int sumComponent = 0; // Equation => k + 2(sum of sum of k (0,k-1) + k) for(int i = 0; i < k; i++) start++; for(int j = start; j < start + k; j++) sumComponent += j; return k + 2*sumComponent; } 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(); } }