import java.util.Scanner;

// ABC172-
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long a = sc.nextInt();

		System.out.println(a + a * a + a * a * a);
		sc.close();
	}

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

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long a = sc.nextInt();

		System.out.println(a + a * a + a * a * a);
		sc.close();
	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long a = sc.nextInt();

		System.out.println(a + a * a + a * a * a);
		sc.close();
	} main {

		Scanner sc = new Scanner(System.in);
		long a = sc.nextInt();

		System.out.println(a + a * a + a * a * a);
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long a = sc.nextInt(); a sc.nextInt() sc.nextInt 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 public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long a = sc.nextInt();

		System.out.println(a + a * a + a * a * a);
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long a = sc.nextInt();

		System.out.println(a + a * a + a * a * a);
		sc.close();
	}

} Main
import java.util.Scanner;

// ABC172-
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long a = sc.nextInt();

		System.out.println(a + a * a + a * a * a);
		sc.close();
	}

}
