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