import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int calc = 0;
		calc = a + (a * a) + (a * a * a);
		System.out.println(calc);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int calc = 0;
		calc = a + (a * a) + (a * a * a);
		System.out.println(calc);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int calc = 0;
		calc = a + (a * a) + (a * a * a);
		System.out.println(calc);
  } main {
    Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int calc = 0;
		calc = a + (a * a) + (a * a * a);
		System.out.println(calc);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int calc = 0; calc 0 calc = a + (a * a) + (a * a * a) calc 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 System.out.println(calc) System.out.println System.out System System.out calc String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int calc = 0;
		calc = a + (a * a) + (a * a * a);
		System.out.println(calc);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int calc = 0;
		calc = a + (a * a) + (a * a * a);
		System.out.println(calc);
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int calc = 0;
		calc = a + (a * a) + (a * a * a);
		System.out.println(calc);
  }
}