import java.util.*;

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double num = sc.nextInt();
      	double power1 = Math.pow(num, 2);
        double power2 = Math.pow(num, 3);
      	double answer = num + power1 + power2;
   
      	System.out.println((int)answer);
    }
}