
import java.util.Scanner;

// Problema atcoder

public class Main {


	public static void main(String args[])  {
		
		String s;
		int n;
		
		
		
		Scanner input = new Scanner(System.in);
		
		n = input.nextInt();
		
		long total = n + (n*n) + (n*n*n);
		
		
	    input.close();
	    
		System.out.println( total);
	
}
}














 import java.util.Scanner; Scanner java.util public class Main {


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


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


	public static void main(String args[])  {
		
		String s;
		int n;
		
		
		
		Scanner input = new Scanner(System.in);
		
		n = input.nextInt();
		
		long total = n + (n*n) + (n*n*n);
		
		
	    input.close();
	    
		System.out.println( total);
	
}
} Main

import java.util.Scanner;

// Problema atcoder

public class Main {


	public static void main(String args[])  {
		
		String s;
		int n;
		
		
		
		Scanner input = new Scanner(System.in);
		
		n = input.nextInt();
		
		long total = n + (n*n) + (n*n*n);
		
		
	    input.close();
	    
		System.out.println( total);
	
}
}















