import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	static int dp[][] = new int[(1 << 21) + 1][21];
	static int dist[][] = new int[21][21];

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int a = Integer.parseInt(br.readLine());

		System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util public class Main {

	static int dp[][] = new int[(1 << 21) + 1][21];
	static int dist[][] = new int[21][21];

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int a = Integer.parseInt(br.readLine());

		System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
	}
} Main static int dp[][] = new int[(1 << 21) + 1][21]; dp new int[(1 << 21) + 1][21] (1 << 21) + 1 (1 << 21) 1 21 1 21 static int dist[][] = new int[21][21]; dist new int[21][21] 21 21 public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int a = Integer.parseInt(br.readLine());

		System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int a = Integer.parseInt(br.readLine());

		System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int a = Integer.parseInt(br.readLine()); a Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3))) System.out.println System.out System System.out (int) (a + Math.pow(a, 2) + Math.pow(a, 3)) a + Math.pow(a, 2) + Math.pow(a, 3) a Math.pow(a, 2) Math.pow Math a 2 Math.pow(a, 3) Math.pow Math a 3 String[] args args public class Main {

	static int dp[][] = new int[(1 << 21) + 1][21];
	static int dist[][] = new int[21][21];

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int a = Integer.parseInt(br.readLine());

		System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
	}
} public class Main {

	static int dp[][] = new int[(1 << 21) + 1][21];
	static int dist[][] = new int[21][21];

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int a = Integer.parseInt(br.readLine());

		System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	static int dp[][] = new int[(1 << 21) + 1][21];
	static int dist[][] = new int[21][21];

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int a = Integer.parseInt(br.readLine());

		System.out.println((int) (a + Math.pow(a, 2) + Math.pow(a, 3)));
	}
}
