
import java.util.Arrays;
import java.util.Scanner;
import java.util.Vector;

//1, 12, 123, 1234
public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long sum = n;
		for (int i = 2; i <= 3; i++) {
			sum+=Math.pow(n, i);
		}
		System.out.println(sum);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util import java.util.Vector; Vector java.util public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long sum = n;
		for (int i = 2; i <= 3; i++) {
			sum+=Math.pow(n, i);
		}
		System.out.println(sum);
	}
} Main public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long sum = n;
		for (int i = 2; i <= 3; i++) {
			sum+=Math.pow(n, i);
		}
		System.out.println(sum);
	} main {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long sum = n;
		for (int i = 2; i <= 3; i++) {
			sum+=Math.pow(n, i);
		}
		System.out.println(sum);
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) long n = in.nextLong(); n in.nextLong() in.nextLong in long sum = n; sum n for (int i = 2; i <= 3; i++) {
			sum+=Math.pow(n, i);
		} int i = 2; int i = 2; i 2 i <= 3 i 3 i++ i++ i {
			sum+=Math.pow(n, i);
		} {
			sum+=Math.pow(n, i);
		} sum+=Math.pow(n, i) sum Math.pow(n, i) Math.pow Math n i System.out.println(sum) System.out.println System.out System System.out sum String args[] args public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long sum = n;
		for (int i = 2; i <= 3; i++) {
			sum+=Math.pow(n, i);
		}
		System.out.println(sum);
	}
} public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long sum = n;
		for (int i = 2; i <= 3; i++) {
			sum+=Math.pow(n, i);
		}
		System.out.println(sum);
	}
} Main

import java.util.Arrays;
import java.util.Scanner;
import java.util.Vector;

//1, 12, 123, 1234
public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		long n = in.nextLong();
		long sum = n;
		for (int i = 2; i <= 3; i++) {
			sum+=Math.pow(n, i);
		}
		System.out.println(sum);
	}
}