import java.util.Scanner;

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

		if (a <= 10) {
			System.out.println(a + (a * a) + (a * a * a));
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		scan.close();

		if (a <= 10) {
			System.out.println(a + (a * a) + (a * a * a));
		}
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		scan.close();

		if (a <= 10) {
			System.out.println(a + (a * a) + (a * a * a));
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		scan.close();

		if (a <= 10) {
			System.out.println(a + (a * a) + (a * a * a));
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan scan.close() scan.close scan if (a <= 10) {
			System.out.println(a + (a * a) + (a * a * a));
		} a <= 10 a 10 {
			System.out.println(a + (a * a) + (a * a * a));
		} System.out.println(a + (a * a) + (a * a * a)) System.out.println System.out System System.out a + (a * a) + (a * a * a) a + (a * a) + (a * a * a) a (a * a) a a (a * a * a) a * a * a a a a String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		scan.close();

		if (a <= 10) {
			System.out.println(a + (a * a) + (a * a * a));
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		scan.close();

		if (a <= 10) {
			System.out.println(a + (a * a) + (a * a * a));
		}
	}
} Main
import java.util.Scanner;

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

		if (a <= 10) {
			System.out.println(a + (a * a) + (a * a * a));
		}
	}
}