import java.util.*; 
public class Main{
    static public void main(String[] args){
        Scanner sc=new Scanner(System.in);
       int a=sc.nextInt();

       int a2=a*a;
       int a3=a*a*a;
       System.out.print(a+a2+a3);
        sc.close();
    }
} import java.util.*; util.* java public class Main{
    static public void main(String[] args){
        Scanner sc=new Scanner(System.in);
       int a=sc.nextInt();

       int a2=a*a;
       int a3=a*a*a;
       System.out.print(a+a2+a3);
        sc.close();
    }
} Main static public void main(String[] args){
        Scanner sc=new Scanner(System.in);
       int a=sc.nextInt();

       int a2=a*a;
       int a3=a*a*a;
       System.out.print(a+a2+a3);
        sc.close();
    } main {
        Scanner sc=new Scanner(System.in);
       int a=sc.nextInt();

       int a2=a*a;
       int a3=a*a*a;
       System.out.print(a+a2+a3);
        sc.close();
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc int a2=a*a; a2 a*a a a int a3=a*a*a; a3 a*a*a a*a*a a a a System.out.print(a+a2+a3) System.out.print System.out System System.out a+a2+a3 a+a2+a3 a a2 a3 sc.close() sc.close sc String[] args args public class Main{
    static public void main(String[] args){
        Scanner sc=new Scanner(System.in);
       int a=sc.nextInt();

       int a2=a*a;
       int a3=a*a*a;
       System.out.print(a+a2+a3);
        sc.close();
    }
} public class Main{
    static public void main(String[] args){
        Scanner sc=new Scanner(System.in);
       int a=sc.nextInt();

       int a2=a*a;
       int a3=a*a*a;
       System.out.print(a+a2+a3);
        sc.close();
    }
} Main
import java.util.*; 
public class Main{
    static public void main(String[] args){
        Scanner sc=new Scanner(System.in);
       int a=sc.nextInt();

       int a2=a*a;
       int a3=a*a*a;
       System.out.print(a+a2+a3);
        sc.close();
    }
}