import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();

            int ans = (int) (n + Math.pow(n,2) + Math.pow(n,3));

            System.out.println(ans);

		} catch (Exception e) {
			// TODO: handle exception
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();

            int ans = (int) (n + Math.pow(n,2) + Math.pow(n,3));

            System.out.println(ans);

		} catch (Exception e) {
			// TODO: handle exception
		}
	}
} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();

            int ans = (int) (n + Math.pow(n,2) + Math.pow(n,3));

            System.out.println(ans);

		} catch (Exception e) {
			// TODO: handle exception
		}
	} main {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();

            int ans = (int) (n + Math.pow(n,2) + Math.pow(n,3));

            System.out.println(ans);

		} catch (Exception e) {
			// TODO: handle exception
		}
	} try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();

            int ans = (int) (n + Math.pow(n,2) + Math.pow(n,3));

            System.out.println(ans);

		} catch (Exception e) {
			// TODO: handle exception
		} catch (Exception e) {
			// TODO: handle exception
		} Exception e {
			// TODO: handle exception
		} {
            int n = sc.nextInt();

            int ans = (int) (n + Math.pow(n,2) + Math.pow(n,3));

            System.out.println(ans);

		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ans = (int) (n + Math.pow(n,2) + Math.pow(n,3)); ans (int) (n + Math.pow(n,2) + Math.pow(n,3)) n + Math.pow(n,2) + Math.pow(n,3) n Math.pow(n,2) Math.pow Math n 2 Math.pow(n,3) Math.pow Math n 3 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();

            int ans = (int) (n + Math.pow(n,2) + Math.pow(n,3));

            System.out.println(ans);

		} catch (Exception e) {
			// TODO: handle exception
		}
	}
} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();

            int ans = (int) (n + Math.pow(n,2) + Math.pow(n,3));

            System.out.println(ans);

		} catch (Exception e) {
			// TODO: handle exception
		}
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();

            int ans = (int) (n + Math.pow(n,2) + Math.pow(n,3));

            System.out.println(ans);

		} catch (Exception e) {
			// TODO: handle exception
		}
	}
}