import java.util.Scanner;

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

		System.out.println(x + x * x + x * x * x);


	}


}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();

		System.out.println(x + x * x + x * x * x);


	}


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

		System.out.println(x + x * x + x * x * x);


	} main {
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();

		System.out.println(x + x * x + x * x * x);


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

		System.out.println(x + x * x + x * x * x);


	}


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

		System.out.println(x + x * x + x * x * x);


	}


} Main
import java.util.Scanner;

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

		System.out.println(x + x * x + x * x * x);


	}


}

