import java.util.*;

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

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