import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
	  Scanner s=new Scanner(System.in);
	  int t=s.nextInt();
	  int ans=t+(t*t)+(t*t*t);
	  System.out.println(ans);
	}
} import java.util.*; util.* java public class Main
{
	public static void main(String[] args)
	{
	  Scanner s=new Scanner(System.in);
	  int t=s.nextInt();
	  int ans=t+(t*t)+(t*t*t);
	  System.out.println(ans);
	}
} Main public static void main(String[] args)
	{
	  Scanner s=new Scanner(System.in);
	  int t=s.nextInt();
	  int ans=t+(t*t)+(t*t*t);
	  System.out.println(ans);
	} main {
	  Scanner s=new Scanner(System.in);
	  int t=s.nextInt();
	  int ans=t+(t*t)+(t*t*t);
	  System.out.println(ans);
	} Scanner s=new Scanner(System.in); s new Scanner(System.in) int t=s.nextInt(); t s.nextInt() s.nextInt s int ans=t+(t*t)+(t*t*t); ans t+(t*t)+(t*t*t) t+(t*t)+(t*t*t) t (t*t) t t (t*t*t) t*t*t t t t System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main
{
	public static void main(String[] args)
	{
	  Scanner s=new Scanner(System.in);
	  int t=s.nextInt();
	  int ans=t+(t*t)+(t*t*t);
	  System.out.println(ans);
	}
} public class Main
{
	public static void main(String[] args)
	{
	  Scanner s=new Scanner(System.in);
	  int t=s.nextInt();
	  int ans=t+(t*t)+(t*t*t);
	  System.out.println(ans);
	}
} Main
import java.util.*;
public class Main
{
	public static void main(String[] args)
	{
	  Scanner s=new Scanner(System.in);
	  int t=s.nextInt();
	  int ans=t+(t*t)+(t*t*t);
	  System.out.println(ans);
	}
}