import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int pow2a = a * a;
		int pow3a = pow2a * a;
		int ans = a + pow2a + pow3a;

		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 = scan.nextInt();
		int pow2a = a * a;
		int pow3a = pow2a * a;
		int ans = a + pow2a + pow3a;

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

		System.out.println(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int pow2a = a * a;
		int pow3a = pow2a * a;
		int ans = a + pow2a + pow3a;

		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int pow2a = a * a; pow2a a * a a a int pow3a = pow2a * a; pow3a pow2a * a pow2a a int ans = a + pow2a + pow3a; ans a + pow2a + pow3a a + pow2a + pow3a a pow2a pow3a 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 = scan.nextInt();
		int pow2a = a * a;
		int pow3a = pow2a * a;
		int ans = a + pow2a + pow3a;

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

		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 = scan.nextInt();
		int pow2a = a * a;
		int pow3a = pow2a * a;
		int ans = a + pow2a + pow3a;

		System.out.println(ans);
	}
}
