import java.util.*;
import java.lang.*;
import java.io.*;



/* Name of the class has to be "Main" only if the class is public. */



public class Main
{
     
     
     static int mod(int a, int m) 
{ 
    return (a%m + m) % m; 
}
   
    
public static void main (String[] args) throws java.lang.Exception
{Scanner scn = new Scanner(System.in) ;

int n = scn.nextInt() ;

int ans  = (n) + (n *n) + (n*n*n) ;

System.out.println(ans) ;

              
}
}




              
              import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main
{
     
     
     static int mod(int a, int m) 
{ 
    return (a%m + m) % m; 
}
   
    
public static void main (String[] args) throws java.lang.Exception
{Scanner scn = new Scanner(System.in) ;

int n = scn.nextInt() ;

int ans  = (n) + (n *n) + (n*n*n) ;

System.out.println(ans) ;

              
}
} Main static int mod(int a, int m) 
{ 
    return (a%m + m) % m; 
} mod { 
    return (a%m + m) % m; 
} return (a%m + m) % m; (a%m + m) % m (a%m + m) a%m a m m m int a a int m m public static void main (String[] args) throws java.lang.Exception
{Scanner scn = new Scanner(System.in) ;

int n = scn.nextInt() ;

int ans  = (n) + (n *n) + (n*n*n) ;

System.out.println(ans) ;

              
} main {Scanner scn = new Scanner(System.in) ;

int n = scn.nextInt() ;

int ans  = (n) + (n *n) + (n*n*n) ;

System.out.println(ans) ;

              
} Scanner scn = new Scanner(System.in) ; scn new Scanner(System.in) int n = scn.nextInt() ; n scn.nextInt() scn.nextInt scn int ans  = (n) + (n *n) + (n*n*n) ; ans (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 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main
{
     
     
     static int mod(int a, int m) 
{ 
    return (a%m + m) % m; 
}
   
    
public static void main (String[] args) throws java.lang.Exception
{Scanner scn = new Scanner(System.in) ;

int n = scn.nextInt() ;

int ans  = (n) + (n *n) + (n*n*n) ;

System.out.println(ans) ;

              
}
} public class Main
{
     
     
     static int mod(int a, int m) 
{ 
    return (a%m + m) % m; 
}
   
    
public static void main (String[] args) throws java.lang.Exception
{Scanner scn = new Scanner(System.in) ;

int n = scn.nextInt() ;

int ans  = (n) + (n *n) + (n*n*n) ;

System.out.println(ans) ;

              
}
} Main
import java.util.*;
import java.lang.*;
import java.io.*;



/* Name of the class has to be "Main" only if the class is public. */



public class Main
{
     
     
     static int mod(int a, int m) 
{ 
    return (a%m + m) % m; 
}
   
    
public static void main (String[] args) throws java.lang.Exception
{Scanner scn = new Scanner(System.in) ;

int n = scn.nextInt() ;

int ans  = (n) + (n *n) + (n*n*n) ;

System.out.println(ans) ;

              
}
}




              
             