import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long sumOfGroup(long k) { // Return the sum of the elements of the k'th group. long st = ((k-1)*(2 + (k - 2)))/2; //System.out.println(st); long n = 1 + (st)*2; //System.out.println(n); long l = 1 + (st+k-1)*2; long res = ((k)*(2*n + ((k-1)*2) ))/2; return res; } public static void main(String[] args) { Scanner in = new Scanner(System.in); long k = in.nextLong(); long answer = sumOfGroup(k); System.out.println(answer); in.close(); } }