
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        long a = scn.nextInt();

        System.out.println((long) (a + Math.pow(a, 2) + Math.pow(a, 3)));
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        long a = scn.nextInt();

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

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

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

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        long a = scn.nextInt();

        System.out.println((long) (a + Math.pow(a, 2) + Math.pow(a, 3)));
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        long a = scn.nextInt();

        System.out.println((long) (a + Math.pow(a, 2) + Math.pow(a, 3)));
    }
} Main

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        long a = scn.nextInt();

        System.out.println((long) (a + Math.pow(a, 2) + Math.pow(a, 3)));
    }
}
