import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner scn = new Scanner(System.in)) {
			int num = scn.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) {
		try (Scanner scn = new Scanner(System.in)) {
			int num = scn.nextInt();
			System.out.println(num + (num*num) + (num*num*num));
		}
	}
} Main public static void main(String[] args) {
		try (Scanner scn = new Scanner(System.in)) {
			int num = scn.nextInt();
			System.out.println(num + (num*num) + (num*num*num));
		}
	} main {
		try (Scanner scn = new Scanner(System.in)) {
			int num = scn.nextInt();
			System.out.println(num + (num*num) + (num*num*num));
		}
	} try (Scanner scn = new Scanner(System.in)) {
			int num = scn.nextInt();
			System.out.println(num + (num*num) + (num*num*num));
		} {
			int num = scn.nextInt();
			System.out.println(num + (num*num) + (num*num*num));
		} Scanner scn = new Scanner(System.in) Scanner scn = new Scanner(System.in) new Scanner(System.in) int num = scn.nextInt(); num scn.nextInt() scn.nextInt scn 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) {
		try (Scanner scn = new Scanner(System.in)) {
			int num = scn.nextInt();
			System.out.println(num + (num*num) + (num*num*num));
		}
	}
} public class Main {
	public static void main(String[] args) {
		try (Scanner scn = new Scanner(System.in)) {
			int num = scn.nextInt();
			System.out.println(num + (num*num) + (num*num*num));
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner scn = new Scanner(System.in)) {
			int num = scn.nextInt();
			System.out.println(num + (num*num) + (num*num*num));
		}
	}
}
