import java.util.*;

public class Main {

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

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

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

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

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        System.out.println((int) Math.ceil(n + Math.pow(n, 2) + Math.pow(n, 3)));
    }
}