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