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