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