import java.util.Scanner;

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

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