import java.util.*;
 
class Main{
  
  public static void main(String args[])
  {
    
    Scanner s = new Scanner(System.in);
      
      int a = s.nextInt();
    	
    long sum=0;
    
    sum=(long)(a+Math.pow(a,2)+Math.pow(a,3));
    
    System.out.println(sum);
    
  }
  
  
} import java.util.*; util.* java class Main{
  
  public static void main(String args[])
  {
    
    Scanner s = new Scanner(System.in);
      
      int a = s.nextInt();
    	
    long sum=0;
    
    sum=(long)(a+Math.pow(a,2)+Math.pow(a,3));
    
    System.out.println(sum);
    
  }
  
  
} Main public static void main(String args[])
  {
    
    Scanner s = new Scanner(System.in);
      
      int a = s.nextInt();
    	
    long sum=0;
    
    sum=(long)(a+Math.pow(a,2)+Math.pow(a,3));
    
    System.out.println(sum);
    
  } main {
    
    Scanner s = new Scanner(System.in);
      
      int a = s.nextInt();
    	
    long sum=0;
    
    sum=(long)(a+Math.pow(a,2)+Math.pow(a,3));
    
    System.out.println(sum);
    
  } Scanner s = new Scanner(System.in); s new Scanner(System.in) int a = s.nextInt(); a s.nextInt() s.nextInt s long sum=0; sum 0 sum=(long)(a+Math.pow(a,2)+Math.pow(a,3)) sum (long)(a+Math.pow(a,2)+Math.pow(a,3)) a+Math.pow(a,2)+Math.pow(a,3) a Math.pow(a,2) Math.pow Math a 2 Math.pow(a,3) Math.pow Math a 3 System.out.println(sum) System.out.println System.out System System.out sum String args[] args
import java.util.*;
 
class Main{
  
  public static void main(String args[])
  {
    
    Scanner s = new Scanner(System.in);
      
      int a = s.nextInt();
    	
    long sum=0;
    
    sum=(long)(a+Math.pow(a,2)+Math.pow(a,3));
    
    System.out.println(sum);
    
  }
  
  
}