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