import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		int a=in.nextInt();
		System.out.println(a+(a*a)+(a*a*a));
	}

} import java.util.*; util.* java import java.io.*; io.* java public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		int a=in.nextInt();
		System.out.println(a+(a*a)+(a*a*a));
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		int a=in.nextInt();
		System.out.println(a+(a*a)+(a*a*a));
	} main {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		int a=in.nextInt();
		System.out.println(a+(a*a)+(a*a*a));
	} Scanner in=new Scanner(System.in); in new Scanner(System.in) int a=in.nextInt(); a in.nextInt() in.nextInt in 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) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		int a=in.nextInt();
		System.out.println(a+(a*a)+(a*a*a));
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		int a=in.nextInt();
		System.out.println(a+(a*a)+(a*a*a));
	}

} Main
import java.util.*;
import java.io.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in=new Scanner(System.in);
		int a=in.nextInt();
		System.out.println(a+(a*a)+(a*a*a));
	}

}
