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 first_ele = k+ (int)Math.pow(k-1, 2); int last_ele = first_ele + 2*(k-1); int sum = (first_ele+last_ele)*k/2; return sum; } 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(); } }