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