import java.util.Scanner;

public class Main {

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

        long num = c.nextInt();
        System.out.println((num + (num * num) + (num * num * num)));

    }

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

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

        long num = c.nextInt();
        System.out.println((num + (num * num) + (num * num * num)));

    }

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

        long num = c.nextInt();
        System.out.println((num + (num * num) + (num * num * num)));

    } main {
        Scanner c = new Scanner(System.in);

        long num = c.nextInt();
        System.out.println((num + (num * num) + (num * num * num)));

    } Scanner c = new Scanner(System.in); c new Scanner(System.in) long num = c.nextInt(); num c.nextInt() c.nextInt c System.out.println((num + (num * num) + (num * num * num))) System.out.println System.out System System.out (num + (num * num) + (num * num * num)) num + (num * num) + (num * num * num) num (num * num) num num (num * num * num) num * num * num num num num String[] args args public class Main {

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

        long num = c.nextInt();
        System.out.println((num + (num * num) + (num * num * num)));

    }

} public class Main {

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

        long num = c.nextInt();
        System.out.println((num + (num * num) + (num * num * num)));

    }

} Main
import java.util.Scanner;

public class Main {

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

        long num = c.nextInt();
        System.out.println((num + (num * num) + (num * num * num)));

    }

}