import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		int k = sc.nextInt();
        System.out.println(k+k*k+k*k*k);
}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		int k = sc.nextInt();
        System.out.println(k+k*k+k*k*k);
}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		int k = sc.nextInt();
        System.out.println(k+k*k+k*k*k);
} main {
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		int k = sc.nextInt();
        System.out.println(k+k*k+k*k*k);
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int k = sc.nextInt(); k sc.nextInt() sc.nextInt sc System.out.println(k+k*k+k*k*k) System.out.println System.out System System.out k+k*k+k*k*k k+k*k+k*k*k k k*k k k k*k*k k*k*k k k k String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		int k = sc.nextInt();
        System.out.println(k+k*k+k*k*k);
}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		int k = sc.nextInt();
        System.out.println(k+k*k+k*k*k);
}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// スペース区切りの整数の入力
		int k = sc.nextInt();
        System.out.println(k+k*k+k*k*k);
}
}