import java.io.*;
public class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
	int a=Integer.parseInt(b.readLine());
    System.out.println(a+a*a+a*a*a);
  }
} import java.io.*; io.* java public class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
	int a=Integer.parseInt(b.readLine());
    System.out.println(a+a*a+a*a*a);
  }
} Main public static void main(String[] args)throws IOException{
    BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
	int a=Integer.parseInt(b.readLine());
    System.out.println(a+a*a+a*a*a);
  } main {
    BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
	int a=Integer.parseInt(b.readLine());
    System.out.println(a+a*a+a*a*a);
  } BufferedReader b = new BufferedReader(new InputStreamReader(System.in)); b new BufferedReader(new InputStreamReader(System.in)) int a=Integer.parseInt(b.readLine()); a Integer.parseInt(b.readLine()) Integer.parseInt Integer b.readLine() b.readLine b System.out.println(a+a*a+a*a*a) System.out.println System.out System System.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 String[] args args public class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
	int a=Integer.parseInt(b.readLine());
    System.out.println(a+a*a+a*a*a);
  }
} public class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
	int a=Integer.parseInt(b.readLine());
    System.out.println(a+a*a+a*a*a);
  }
} Main
import java.io.*;
public class Main{
  public static void main(String[] args)throws IOException{
    BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
	int a=Integer.parseInt(b.readLine());
    System.out.println(a+a*a+a*a*a);
  }
}
