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

class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		
		System.out.println(num + num * num + num * num * num);
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java import java.math.BigDecimal; BigDecimal java.math class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		
		System.out.println(num + num * num + num * num * num);
	}
} Main public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		
		System.out.println(num + num * num + num * num * num);
	} main {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		
		System.out.println(num + num * num + num * num * num);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc System.out.println(num + num * num + num * num * num) System.out.println System.out System System.out num + num * num + num * num * num num + num * num + num * num * num num num * num num num num * num * num num * num * num num num num String[] args args
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.BigDecimal;

class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		
		System.out.println(num + num * num + num * num * num);
	}
}
