import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int n = a + (a*a) + (a*a*a);
		System.out.println(n);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int n = a + (a*a) + (a*a*a);
		System.out.println(n);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int n = a + (a*a) + (a*a*a);
		System.out.println(n);
	} main {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int n = a + (a*a) + (a*a*a);
		System.out.println(n);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int n = a + (a*a) + (a*a*a); n 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(n) System.out.println System.out System System.out n String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int n = a + (a*a) + (a*a*a);
		System.out.println(n);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int n = a + (a*a) + (a*a*a);
		System.out.println(n);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		int n = a + (a*a) + (a*a*a);
		System.out.println(n);
	}
}
