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