import java.util.Scanner;

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

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