import java.io.*;

public class Main{
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	
	public static void main (String[] args) throws IOException{
        int a = Integer.parseInt(br.readLine());
        int ans = a + a*a + a*a*a;
        bw.write(ans + "");
		bw.flush();
	}
} import java.io.*; io.* java public class Main{
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	
	public static void main (String[] args) throws IOException{
        int a = Integer.parseInt(br.readLine());
        int ans = a + a*a + a*a*a;
        bw.write(ans + "");
		bw.flush();
	}
} Main private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); bw new BufferedWriter(new OutputStreamWriter(System.out)) public static void main (String[] args) throws IOException{
        int a = Integer.parseInt(br.readLine());
        int ans = a + a*a + a*a*a;
        bw.write(ans + "");
		bw.flush();
	} main {
        int a = Integer.parseInt(br.readLine());
        int ans = a + a*a + a*a*a;
        bw.write(ans + "");
		bw.flush();
	} int a = Integer.parseInt(br.readLine()); a Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br 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 bw.write(ans + "") bw.write bw ans + "" ans "" bw.flush() bw.flush bw String[] args args public class Main{
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	
	public static void main (String[] args) throws IOException{
        int a = Integer.parseInt(br.readLine());
        int ans = a + a*a + a*a*a;
        bw.write(ans + "");
		bw.flush();
	}
} public class Main{
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	
	public static void main (String[] args) throws IOException{
        int a = Integer.parseInt(br.readLine());
        int ans = a + a*a + a*a*a;
        bw.write(ans + "");
		bw.flush();
	}
} Main
import java.io.*;

public class Main{
	private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	
	public static void main (String[] args) throws IOException{
        int a = Integer.parseInt(br.readLine());
        int ans = a + a*a + a*a*a;
        bw.write(ans + "");
		bw.flush();
	}
}
