import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (final Scanner sc = new Scanner(System.in);) {
			final int a = sc.nextInt();
			System.out.println(a*(1+a + a*a));

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

	public static void main(String[] args) {
		try (final Scanner sc = new Scanner(System.in);) {
			final int a = sc.nextInt();
			System.out.println(a*(1+a + a*a));

		}
	}
} Main public static void main(String[] args) {
		try (final Scanner sc = new Scanner(System.in);) {
			final int a = sc.nextInt();
			System.out.println(a*(1+a + a*a));

		}
	} main {
		try (final Scanner sc = new Scanner(System.in);) {
			final int a = sc.nextInt();
			System.out.println(a*(1+a + a*a));

		}
	} try (final Scanner sc = new Scanner(System.in);) {
			final int a = sc.nextInt();
			System.out.println(a*(1+a + a*a));

		} {
			final int a = sc.nextInt();
			System.out.println(a*(1+a + a*a));

		} final Scanner sc = new Scanner(System.in) final Scanner sc = new Scanner(System.in) new Scanner(System.in) final int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc System.out.println(a*(1+a + a*a)) System.out.println System.out System System.out a*(1+a + a*a) a (1+a + a*a) 1+a + a*a 1 a a*a a a String[] args args public class Main {

	public static void main(String[] args) {
		try (final Scanner sc = new Scanner(System.in);) {
			final int a = sc.nextInt();
			System.out.println(a*(1+a + a*a));

		}
	}
} public class Main {

	public static void main(String[] args) {
		try (final Scanner sc = new Scanner(System.in);) {
			final int a = sc.nextInt();
			System.out.println(a*(1+a + a*a));

		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (final Scanner sc = new Scanner(System.in);) {
			final int a = sc.nextInt();
			System.out.println(a*(1+a + a*a));

		}
	}
}