import java.util.*;
import java.io.*;
public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      int a = Integer.parseInt(st.nextToken());
      out.println(a+a*a+a*a*a);
      out.close();
   }
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      int a = Integer.parseInt(st.nextToken());
      out.println(a+a*a+a*a*a);
      out.close();
   }
} Main public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      int a = Integer.parseInt(st.nextToken());
      out.println(a+a*a+a*a*a);
      out.close();
   } main {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      int a = Integer.parseInt(st.nextToken());
      out.println(a+a*a+a*a*a);
      out.close();
   } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int a = Integer.parseInt(st.nextToken()); a Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st out.println(a+a*a+a*a*a) out.println out a+a*a+a*a*a a+a*a+a*a*a a a*a a a a*a*a a*a*a a a a out.close() out.close out String[] main main public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      int a = Integer.parseInt(st.nextToken());
      out.println(a+a*a+a*a*a);
      out.close();
   }
} public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      int a = Integer.parseInt(st.nextToken());
      out.println(a+a*a+a*a*a);
      out.close();
   }
} Main
import java.util.*;
import java.io.*;
public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      int a = Integer.parseInt(st.nextToken());
      out.println(a+a*a+a*a*a);
      out.close();
   }
}