import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
 		//入力された値の取得
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		//計算
		int answer = a + a * a + a * a * a;
		//出力
		System.out.println(answer);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) throws Exception {
 		//入力された値の取得
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		//計算
		int answer = a + a * a + a * a * a;
		//出力
		System.out.println(answer);
	}
} Main public static void main(String[] args) throws Exception {
 		//入力された値の取得
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		//計算
		int answer = a + a * a + a * a * a;
		//出力
		System.out.println(answer);
	} main {
 		//入力された値の取得
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		//計算
		int answer = a + a * a + a * a * a;
		//出力
		System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int answer = a + a * a + a * a * a; answer 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(answer) System.out.println System.out System System.out answer String[] args args public class Main {
	public static void main(String[] args) throws Exception {
 		//入力された値の取得
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		//計算
		int answer = a + a * a + a * a * a;
		//出力
		System.out.println(answer);
	}
} public class Main {
	public static void main(String[] args) throws Exception {
 		//入力された値の取得
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		//計算
		int answer = a + a * a + a * a * a;
		//出力
		System.out.println(answer);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
 		//入力された値の取得
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		//計算
		int answer = a + a * a + a * a * a;
		//出力
		System.out.println(answer);
	}
}
