import java.util.*; import java.io.*; class NumberGroup { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); static StringTokenizer st = null; static String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } static int nextInt() { return Integer.parseInt(next()); } static long nextLong() { return Long.parseLong(next()); } public static void main(String args[]) { try { long k=nextInt(); long a=k*(k-1); a=a+1; long sum=0; while(k-->0) { sum+=a; a+=2; } System.out.println(sum); bw.flush(); } catch (Exception e) { e.printStackTrace(); } } }