import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());

 		long ans = n + n * n + n* n* n;

 		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());

 		long ans = n + n * n + n* n* n;

 		System.out.println(ans);
	}
} Main public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());

 		long ans = n + n * n + n* n* n;

 		System.out.println(ans);
	} main {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());

 		long ans = n + n * n + n* n* n;

 		System.out.println(ans);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.nextLine()); n Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner long ans = n + n * n + n* n* n; ans n + n * n + n* n* n n + n * n + n* n* n n n * n n n n* n* n n* n* n n n n System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());

 		long ans = n + n * n + n* n* n;

 		System.out.println(ans);
	}
} public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());

 		long ans = n + n * n + n* n* n;

 		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());

 		long ans = n + n * n + n* n* n;

 		System.out.println(ans);
	}
}
