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