import java.lang.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int num = scan.nextInt();

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

        int num = scan.nextInt();

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

        int num = scan.nextInt();

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

        int num = scan.nextInt();

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

        int num = scan.nextInt();

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

        int num = scan.nextInt();

        System.out.println((int)(num + Math.pow(num, 2) + Math.pow(num, 3)));
    }
} Main
import java.lang.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int num = scan.nextInt();

        System.out.println((int)(num + Math.pow(num, 2) + Math.pow(num, 3)));
    }
}
