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