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

public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);


		int a = sc.nextInt();

		int res = a + a*a + a*a*a;

		System.out.println(res);

		sc.close();
		System.out.flush();
	}
} import java.io.*; io.* java import java.util.*; util.* java import java.lang.*; lang.* java public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);


		int a = sc.nextInt();

		int res = a + a*a + a*a*a;

		System.out.println(res);

		sc.close();
		System.out.flush();
	}
} Main public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);


		int a = sc.nextInt();

		int res = a + a*a + a*a*a;

		System.out.println(res);

		sc.close();
		System.out.flush();
	} main {
		Scanner sc = new Scanner(System.in);


		int a = sc.nextInt();

		int res = a + a*a + a*a*a;

		System.out.println(res);

		sc.close();
		System.out.flush();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int res = a + a*a + a*a*a; res 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 System.out.println(res) System.out.println System.out System System.out res sc.close() sc.close sc System.out.flush() System.out.flush System.out System System.out String args[] args public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);


		int a = sc.nextInt();

		int res = a + a*a + a*a*a;

		System.out.println(res);

		sc.close();
		System.out.flush();
	}
} public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);


		int a = sc.nextInt();

		int res = a + a*a + a*a*a;

		System.out.println(res);

		sc.close();
		System.out.flush();
	}
} Main
import java.io.*;
import java.util.*;
import java.lang.*;

public class Main
{
	public static void main(String args[]) throws java.lang.Exception,FileNotFoundException
	{
		Scanner sc = new Scanner(System.in);


		int a = sc.nextInt();

		int res = a + a*a + a*a*a;

		System.out.println(res);

		sc.close();
		System.out.flush();
	}
}