/*
------------------------------|بسم الله الرحمن الرحيم|------------------------------//
------------"IN THE NAME OF ALLAH, THE MOST GRACIUOS, THE MOST MERCIFUL"-------------//
__________________________________ShahnawazShaikh_____________________________________
*/
import java.io.*;
import java.util.*;
public class Main{
	public static void main(String[] x) throws java.lang.Exception{
	Scanner sc=new Scanner(System.in);
    short a=sc.nextShort();
    System.out.println(a+a*a+a*a*a);
	

	}

} import java.io.*; io.* java import java.util.*; util.* java public class Main{
	public static void main(String[] x) throws java.lang.Exception{
	Scanner sc=new Scanner(System.in);
    short a=sc.nextShort();
    System.out.println(a+a*a+a*a*a);
	

	}

} Main public static void main(String[] x) throws java.lang.Exception{
	Scanner sc=new Scanner(System.in);
    short a=sc.nextShort();
    System.out.println(a+a*a+a*a*a);
	

	} main {
	Scanner sc=new Scanner(System.in);
    short a=sc.nextShort();
    System.out.println(a+a*a+a*a*a);
	

	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) short a=sc.nextShort(); a sc.nextShort() sc.nextShort sc 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 String[] x x public class Main{
	public static void main(String[] x) throws java.lang.Exception{
	Scanner sc=new Scanner(System.in);
    short a=sc.nextShort();
    System.out.println(a+a*a+a*a*a);
	

	}

} public class Main{
	public static void main(String[] x) throws java.lang.Exception{
	Scanner sc=new Scanner(System.in);
    short a=sc.nextShort();
    System.out.println(a+a*a+a*a*a);
	

	}

} Main
/*
------------------------------|بسم الله الرحمن الرحيم|------------------------------//
------------"IN THE NAME OF ALLAH, THE MOST GRACIUOS, THE MOST MERCIFUL"-------------//
__________________________________ShahnawazShaikh_____________________________________
*/
import java.io.*;
import java.util.*;
public class Main{
	public static void main(String[] x) throws java.lang.Exception{
	Scanner sc=new Scanner(System.in);
    short a=sc.nextShort();
    System.out.println(a+a*a+a*a*a);
	

	}

}