import java.util.*;
import java.io.*;
public class Main{
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	int a = Integer.parseInt(reader.readLine());
	int res = a+a*a+a*a*a;
	System.out.println(res);
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	int a = Integer.parseInt(reader.readLine());
	int res = a+a*a+a*a*a;
	System.out.println(res);
	}
} Main public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	int a = Integer.parseInt(reader.readLine());
	int res = a+a*a+a*a*a;
	System.out.println(res);
	} main {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	int a = Integer.parseInt(reader.readLine());
	int res = a+a*a+a*a*a;
	System.out.println(res);
	} BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) int a = Integer.parseInt(reader.readLine()); a Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader int res = a+a*a+a*a*a; res 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(res) System.out.println System.out System System.out res String[] args args public class Main{
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	int a = Integer.parseInt(reader.readLine());
	int res = a+a*a+a*a*a;
	System.out.println(res);
	}
} public class Main{
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	int a = Integer.parseInt(reader.readLine());
	int res = a+a*a+a*a*a;
	System.out.println(res);
	}
} Main
import java.util.*;
import java.io.*;
public class Main{
	public static void main(String[] args) throws IOException{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
	int a = Integer.parseInt(reader.readLine());
	int res = a+a*a+a*a*a;
	System.out.println(res);
	}
}
