
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = Integer.parseInt(sc.nextLine());
		System.out.println(line + line * line + line * line * line);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = Integer.parseInt(sc.nextLine());
		System.out.println(line + line * line + line * line * line);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = Integer.parseInt(sc.nextLine());
		System.out.println(line + line * line + line * line * line);
	} main {
		Scanner sc = new Scanner(System.in);
		int line = Integer.parseInt(sc.nextLine());
		System.out.println(line + line * line + line * line * line);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int line = Integer.parseInt(sc.nextLine()); line Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc System.out.println(line + line * line + line * line * line) System.out.println System.out System System.out line + line * line + line * line * line line + line * line + line * line * line line line * line line line line * line * line line * line * line line line line String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = Integer.parseInt(sc.nextLine());
		System.out.println(line + line * line + line * line * line);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = Integer.parseInt(sc.nextLine());
		System.out.println(line + line * line + line * line * line);
	}
} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int line = Integer.parseInt(sc.nextLine());
		System.out.println(line + line * line + line * line * line);
	}
}
