
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		System.out.println((int) (n + Math.pow(n, 2) + Math.pow(n, 3)));

	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		System.out.println((int) (n + Math.pow(n, 2) + Math.pow(n, 3)));

	}

} Main public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		System.out.println((int) (n + Math.pow(n, 2) + Math.pow(n, 3)));

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

	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br System.out.println((int) (n + Math.pow(n, 2) + Math.pow(n, 3))) System.out.println System.out System System.out (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 String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		System.out.println((int) (n + Math.pow(n, 2) + Math.pow(n, 3)));

	}

} public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		System.out.println((int) (n + Math.pow(n, 2) + Math.pow(n, 3)));

	}

} Main

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		System.out.println((int) (n + Math.pow(n, 2) + Math.pow(n, 3)));

	}

}
