import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = Integer.parseInt(scan.next());
		int ans = (int)Math.floor(a + Math.pow(a, 2) + Math.pow(a, 3));

		System.out.println(ans);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = Integer.parseInt(scan.next());
		int ans = (int)Math.floor(a + Math.pow(a, 2) + Math.pow(a, 3));

		System.out.println(ans);
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = Integer.parseInt(scan.next());
		int ans = (int)Math.floor(a + Math.pow(a, 2) + Math.pow(a, 3));

		System.out.println(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		int a = Integer.parseInt(scan.next());
		int ans = (int)Math.floor(a + Math.pow(a, 2) + Math.pow(a, 3));

		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = Integer.parseInt(scan.next()); a Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int ans = (int)Math.floor(a + Math.pow(a, 2) + Math.pow(a, 3)); ans (int)Math.floor(a + Math.pow(a, 2) + Math.pow(a, 3)) Math.floor Math a + Math.pow(a, 2) + Math.pow(a, 3) a + Math.pow(a, 2) + Math.pow(a, 3) a Math.pow(a, 2) Math.pow Math a 2 Math.pow(a, 3) Math.pow Math a 3 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 scan = new Scanner(System.in);
		int a = Integer.parseInt(scan.next());
		int ans = (int)Math.floor(a + Math.pow(a, 2) + Math.pow(a, 3));

		System.out.println(ans);
	}

} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = Integer.parseInt(scan.next());
		int ans = (int)Math.floor(a + Math.pow(a, 2) + Math.pow(a, 3));

		System.out.println(ans);
	}

} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = Integer.parseInt(scan.next());
		int ans = (int)Math.floor(a + Math.pow(a, 2) + Math.pow(a, 3));

		System.out.println(ans);
	}

}
