import java.util.*;
import java.io.PrintWriter;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long a=sc.nextLong();
		System.out.println(a+a*a+a*a*a);
	}
} import java.util.*; util.* java import java.io.PrintWriter; PrintWriter java.io public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long a=sc.nextLong();
		System.out.println(a+a*a+a*a*a);
	}
} Main public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long a=sc.nextLong();
		System.out.println(a+a*a+a*a*a);
	} main {
		Scanner sc=new Scanner(System.in);
		long a=sc.nextLong();
		System.out.println(a+a*a+a*a*a);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) long a=sc.nextLong(); a sc.nextLong() sc.nextLong sc System.out.println(a+a*a+a*a*a) System.out.println System.out System System.out 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 String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long a=sc.nextLong();
		System.out.println(a+a*a+a*a*a);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		long a=sc.nextLong();
		System.out.println(a+a*a+a*a*a);
	}
} Main
import java.util.*;
import java.io.PrintWriter;

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