import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			double a = Double.parseDouble(data);

			BigDecimal b1 = new BigDecimal(String.valueOf(Math.pow(a, 1)));
			BigDecimal b2 = new BigDecimal(String.valueOf(Math.pow(a, 2)));
			BigDecimal b3 = new BigDecimal(String.valueOf(Math.pow(a, 3)));

			System.out.println(b1.add(b2).add(b3).longValue());
		}
	}
} import java.math.BigDecimal; BigDecimal java.math import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			double a = Double.parseDouble(data);

			BigDecimal b1 = new BigDecimal(String.valueOf(Math.pow(a, 1)));
			BigDecimal b2 = new BigDecimal(String.valueOf(Math.pow(a, 2)));
			BigDecimal b3 = new BigDecimal(String.valueOf(Math.pow(a, 3)));

			System.out.println(b1.add(b2).add(b3).longValue());
		}
	}
} Main public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			double a = Double.parseDouble(data);

			BigDecimal b1 = new BigDecimal(String.valueOf(Math.pow(a, 1)));
			BigDecimal b2 = new BigDecimal(String.valueOf(Math.pow(a, 2)));
			BigDecimal b3 = new BigDecimal(String.valueOf(Math.pow(a, 3)));

			System.out.println(b1.add(b2).add(b3).longValue());
		}
	} main {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			double a = Double.parseDouble(data);

			BigDecimal b1 = new BigDecimal(String.valueOf(Math.pow(a, 1)));
			BigDecimal b2 = new BigDecimal(String.valueOf(Math.pow(a, 2)));
			BigDecimal b3 = new BigDecimal(String.valueOf(Math.pow(a, 3)));

			System.out.println(b1.add(b2).add(b3).longValue());
		}
	} try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			double a = Double.parseDouble(data);

			BigDecimal b1 = new BigDecimal(String.valueOf(Math.pow(a, 1)));
			BigDecimal b2 = new BigDecimal(String.valueOf(Math.pow(a, 2)));
			BigDecimal b3 = new BigDecimal(String.valueOf(Math.pow(a, 3)));

			System.out.println(b1.add(b2).add(b3).longValue());
		} {
			String data = scanner.nextLine();

			double a = Double.parseDouble(data);

			BigDecimal b1 = new BigDecimal(String.valueOf(Math.pow(a, 1)));
			BigDecimal b2 = new BigDecimal(String.valueOf(Math.pow(a, 2)));
			BigDecimal b3 = new BigDecimal(String.valueOf(Math.pow(a, 3)));

			System.out.println(b1.add(b2).add(b3).longValue());
		} Scanner scanner = new Scanner(System.in) Scanner scanner = new Scanner(System.in) new Scanner(System.in) String data = scanner.nextLine(); data scanner.nextLine() scanner.nextLine scanner double a = Double.parseDouble(data); a Double.parseDouble(data) Double.parseDouble Double data BigDecimal b1 = new BigDecimal(String.valueOf(Math.pow(a, 1))); b1 new BigDecimal(String.valueOf(Math.pow(a, 1))) BigDecimal b2 = new BigDecimal(String.valueOf(Math.pow(a, 2))); b2 new BigDecimal(String.valueOf(Math.pow(a, 2))) BigDecimal b3 = new BigDecimal(String.valueOf(Math.pow(a, 3))); b3 new BigDecimal(String.valueOf(Math.pow(a, 3))) System.out.println(b1.add(b2).add(b3).longValue()) System.out.println System.out System System.out b1.add(b2).add(b3).longValue() b1.add(b2).add(b3).longValue b1.add(b2).add(b3) b1.add(b2).add b1.add(b2) b1.add b1 b2 b3 String[] args args public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			double a = Double.parseDouble(data);

			BigDecimal b1 = new BigDecimal(String.valueOf(Math.pow(a, 1)));
			BigDecimal b2 = new BigDecimal(String.valueOf(Math.pow(a, 2)));
			BigDecimal b3 = new BigDecimal(String.valueOf(Math.pow(a, 3)));

			System.out.println(b1.add(b2).add(b3).longValue());
		}
	}
} public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			double a = Double.parseDouble(data);

			BigDecimal b1 = new BigDecimal(String.valueOf(Math.pow(a, 1)));
			BigDecimal b2 = new BigDecimal(String.valueOf(Math.pow(a, 2)));
			BigDecimal b3 = new BigDecimal(String.valueOf(Math.pow(a, 3)));

			System.out.println(b1.add(b2).add(b3).longValue());
		}
	}
} Main
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try(Scanner scanner = new Scanner(System.in)) {
			String data = scanner.nextLine();

			double a = Double.parseDouble(data);

			BigDecimal b1 = new BigDecimal(String.valueOf(Math.pow(a, 1)));
			BigDecimal b2 = new BigDecimal(String.valueOf(Math.pow(a, 2)));
			BigDecimal b3 = new BigDecimal(String.valueOf(Math.pow(a, 3)));

			System.out.println(b1.add(b2).add(b3).longValue());
		}
	}
}