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