import java.util.Scanner;

public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		sc.close();
		prtln(a + (a * a) + (a * a * a));
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		sc.close();
		prtln(a + (a * a) + (a * a * a));
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} Main public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		sc.close();
		prtln(a + (a * a) + (a * a * a));
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		sc.close();
		prtln(a + (a * a) + (a * a * a));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc sc.close() sc.close sc prtln(a + (a * a) + (a * a * a)) prtln 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 final String[] args args public static <T> void prtln(T t) { System.out.println(t); } prtln { System.out.println(t); } System.out.println(t) System.out.println System.out System System.out t T t t public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		sc.close();
		prtln(a + (a * a) + (a * a * a));
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		sc.close();
		prtln(a + (a * a) + (a * a * a));
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} Main
import java.util.Scanner;

public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		sc.close();
		prtln(a + (a * a) + (a * a * a));
	}

	public static <T> void prtln(T t) { System.out.println(t); }
}
