import java.util.*;

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

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