

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


 public class Main
{
	public static void main (String[] args) throws java.lang.Exception{

	Scanner sc=new Scanner(System.in);
	int a=sc.nextInt();
	int b= a*a;
	int c= b*a;
	int d=a+b+c;
	
	System.out.println(d);
   sc.close();
	}

}

	
 import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main
{
	public static void main (String[] args) throws java.lang.Exception{

	Scanner sc=new Scanner(System.in);
	int a=sc.nextInt();
	int b= a*a;
	int c= b*a;
	int d=a+b+c;
	
	System.out.println(d);
   sc.close();
	}

} Main public static void main (String[] args) throws java.lang.Exception{

	Scanner sc=new Scanner(System.in);
	int a=sc.nextInt();
	int b= a*a;
	int c= b*a;
	int d=a+b+c;
	
	System.out.println(d);
   sc.close();
	} main {

	Scanner sc=new Scanner(System.in);
	int a=sc.nextInt();
	int b= a*a;
	int c= b*a;
	int d=a+b+c;
	
	System.out.println(d);
   sc.close();
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc int b= a*a; b a*a a a int c= b*a; c b*a b a int d=a+b+c; d a+b+c a+b+c a b c System.out.println(d) System.out.println System.out System System.out d sc.close() sc.close sc String[] args args public class Main
{
	public static void main (String[] args) throws java.lang.Exception{

	Scanner sc=new Scanner(System.in);
	int a=sc.nextInt();
	int b= a*a;
	int c= b*a;
	int d=a+b+c;
	
	System.out.println(d);
   sc.close();
	}

} public class Main
{
	public static void main (String[] args) throws java.lang.Exception{

	Scanner sc=new Scanner(System.in);
	int a=sc.nextInt();
	int b= a*a;
	int c= b*a;
	int d=a+b+c;
	
	System.out.println(d);
   sc.close();
	}

} Main


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


 public class Main
{
	public static void main (String[] args) throws java.lang.Exception{

	Scanner sc=new Scanner(System.in);
	int a=sc.nextInt();
	int b= a*a;
	int c= b*a;
	int d=a+b+c;
	
	System.out.println(d);
   sc.close();
	}

}

	

