import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static long sumOfGroup(int k) { long k1=k; k1--; long g=k1*(k1+1)/(long)2; g=g+1; long a=1+(g-1)*2; //long a = (g%2==0)?(g+1):g; //System.out.println(a); return (k)*(a+(k-1)); // Return the sum of the elements of the k'th group. } 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(); } }