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 d = k * (k-1) + 1; long s = 0; long groupe = k + k - 1; for(long i = d; i < d+groupe; i++){ if(i%2 == 1){ s += i; } } return s; } public static void main(String[] args) { Scanner in = new Scanner(System.in); long k = in.nextInt(); long answer = sumOfGroup(k); System.out.println(answer); in.close(); } }