import java.util.Scanner;

public class Main {

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

    }

} import java.util.Scanner; Scanner java.util public class Main {

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

    }

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

    } main {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int res = (int) ((int) a + Math.pow(a, 2) + Math.pow(a, 3));
        System.out.println(res);

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

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

    }

} public class Main {

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

    }

} Main
import java.util.Scanner;

public class Main {

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

    }

}