import java.io.*;
public class Main
{
	public static void main(String[] args) throws IOException
	{
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    int n=Integer.parseInt(br.readLine());
	    
		System.out.println(n+(n*n)+(n*n*n));
	}
} import java.io.*; io.* java public class Main
{
	public static void main(String[] args) throws IOException
	{
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    int n=Integer.parseInt(br.readLine());
	    
		System.out.println(n+(n*n)+(n*n*n));
	}
} Main public static void main(String[] args) throws IOException
	{
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    int n=Integer.parseInt(br.readLine());
	    
		System.out.println(n+(n*n)+(n*n*n));
	} main {
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    int n=Integer.parseInt(br.readLine());
	    
		System.out.println(n+(n*n)+(n*n*n));
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n=Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br System.out.println(n+(n*n)+(n*n*n)) System.out.println System.out System System.out 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 String[] args args public class Main
{
	public static void main(String[] args) throws IOException
	{
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    int n=Integer.parseInt(br.readLine());
	    
		System.out.println(n+(n*n)+(n*n*n));
	}
} public class Main
{
	public static void main(String[] args) throws IOException
	{
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    int n=Integer.parseInt(br.readLine());
	    
		System.out.println(n+(n*n)+(n*n*n));
	}
} Main
import java.io.*;
public class Main
{
	public static void main(String[] args) throws IOException
	{
	    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    int n=Integer.parseInt(br.readLine());
	    
		System.out.println(n+(n*n)+(n*n*n));
	}
}
