import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		System.out.println(a + a*a + a*a*a);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		System.out.println(a + a*a + a*a*a);
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		System.out.println(a + a*a + a*a*a);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		System.out.println(a + a*a + a*a*a);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next 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 sc.close() sc.close sc String[] args args
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		System.out.println(a + a*a + a*a*a);
		sc.close();
	}
}