import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

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

} import java.io.*; io.* java import java.util.*; util.* java import java.text.*; text.* java import java.math.*; math.* java import java.util.regex.*; regex.* java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int ans = num + (num*num) + (num*num*num);
		System.out.println(ans);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int ans = num + (num*num) + (num*num*num);
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int ans = num + (num*num) + (num*num*num);
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int ans = num + (num*num) + (num*num*num); ans num + (num*num) + (num*num*num) num + (num*num) + (num*num*num) num (num*num) num num (num*num*num) num*num*num num num num 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 sc = new Scanner(System.in);
		int num = sc.nextInt();
		int ans = num + (num*num) + (num*num*num);
		System.out.println(ans);
	}

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

} Main
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

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

}