import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		double kekka;
		int kekka2;
		
		if((1<=a)&&(a<=10)) {
			kekka = a+Math.pow(a,2)+Math.pow(a,3);
			kekka2 = (int)kekka;
			System.out.println(kekka2);
		}
		
		sc.close();

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		double kekka;
		int kekka2;
		
		if((1<=a)&&(a<=10)) {
			kekka = a+Math.pow(a,2)+Math.pow(a,3);
			kekka2 = (int)kekka;
			System.out.println(kekka2);
		}
		
		sc.close();

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		double kekka;
		int kekka2;
		
		if((1<=a)&&(a<=10)) {
			kekka = a+Math.pow(a,2)+Math.pow(a,3);
			kekka2 = (int)kekka;
			System.out.println(kekka2);
		}
		
		sc.close();

	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		double kekka;
		int kekka2;
		
		if((1<=a)&&(a<=10)) {
			kekka = a+Math.pow(a,2)+Math.pow(a,3);
			kekka2 = (int)kekka;
			System.out.println(kekka2);
		}
		
		sc.close();

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc double kekka; kekka int kekka2; kekka2 if((1<=a)&&(a<=10)) {
			kekka = a+Math.pow(a,2)+Math.pow(a,3);
			kekka2 = (int)kekka;
			System.out.println(kekka2);
		} (1<=a)&&(a<=10) (1<=a) 1 a (a<=10) a 10 {
			kekka = a+Math.pow(a,2)+Math.pow(a,3);
			kekka2 = (int)kekka;
			System.out.println(kekka2);
		} kekka = a+Math.pow(a,2)+Math.pow(a,3) kekka a+Math.pow(a,2)+Math.pow(a,3) a+Math.pow(a,2)+Math.pow(a,3) a Math.pow(a,2) Math.pow Math a 2 Math.pow(a,3) Math.pow Math a 3 kekka2 = (int)kekka kekka2 (int)kekka System.out.println(kekka2) System.out.println System.out System System.out kekka2 sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		double kekka;
		int kekka2;
		
		if((1<=a)&&(a<=10)) {
			kekka = a+Math.pow(a,2)+Math.pow(a,3);
			kekka2 = (int)kekka;
			System.out.println(kekka2);
		}
		
		sc.close();

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		double kekka;
		int kekka2;
		
		if((1<=a)&&(a<=10)) {
			kekka = a+Math.pow(a,2)+Math.pow(a,3);
			kekka2 = (int)kekka;
			System.out.println(kekka2);
		}
		
		sc.close();

	}

} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		double kekka;
		int kekka2;
		
		if((1<=a)&&(a<=10)) {
			kekka = a+Math.pow(a,2)+Math.pow(a,3);
			kekka2 = (int)kekka;
			System.out.println(kekka2);
		}
		
		sc.close();

	}

}