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[] num=new long[1000000]; long sum=0; long no=(((k)*(k-1))/2)+1; long first=1+(no-1)*2; for(long i=1;i<=k;i++) { sum=sum+first; first=first+2; } return sum; } 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(); } }