import java.util.*;
 
class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    double a = sc.nextDouble();
    double calc1 = Math.pow(a,2);
    double calc2 = Math.pow(a,3);
    
    System.out.println((int)a + (int)calc1 + (int)calc2);
  }
} import java.util.*; util.* java class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    double a = sc.nextDouble();
    double calc1 = Math.pow(a,2);
    double calc2 = Math.pow(a,3);
    
    System.out.println((int)a + (int)calc1 + (int)calc2);
  }
} Main public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    double a = sc.nextDouble();
    double calc1 = Math.pow(a,2);
    double calc2 = Math.pow(a,3);
    
    System.out.println((int)a + (int)calc1 + (int)calc2);
  } main {
    Scanner sc = new Scanner(System.in);
    double a = sc.nextDouble();
    double calc1 = Math.pow(a,2);
    double calc2 = Math.pow(a,3);
    
    System.out.println((int)a + (int)calc1 + (int)calc2);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double a = sc.nextDouble(); a sc.nextDouble() sc.nextDouble sc double calc1 = Math.pow(a,2); calc1 Math.pow(a,2) Math.pow Math a 2 double calc2 = Math.pow(a,3); calc2 Math.pow(a,3) Math.pow Math a 3 System.out.println((int)a + (int)calc1 + (int)calc2) System.out.println System.out System System.out (int)a + (int)calc1 + (int)calc2 (int)a + (int)calc1 + (int)calc2 (int)a (int)calc1 (int)calc2 String args[] args
import java.util.*;
 
class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    double a = sc.nextDouble();
    double calc1 = Math.pow(a,2);
    double calc2 = Math.pow(a,3);
    
    System.out.println((int)a + (int)calc1 + (int)calc2);
  }
}