
import java.io.InputStreamReader;
import java.util.Scanner;

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

import java.io.InputStreamReader;
import java.util.Scanner;

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