import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

public class Main {
	
	
	
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		System.out.println(n+n*n+n*n*n);
	}

} import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util public class Main {
	
	
	
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		System.out.println(n+n*n+n*n*n);
	}

} Main public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		System.out.println(n+n*n+n*n*n);
	} main {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		System.out.println(n+n*n+n*n*n);
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s System.out.println(n+n*n+n*n*n) System.out.println System.out System System.out n+n*n+n*n*n n+n*n+n*n*n n n*n n n n*n*n n*n*n n n n String[] args args public class Main {
	
	
	
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		System.out.println(n+n*n+n*n*n);
	}

} public class Main {
	
	
	
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		System.out.println(n+n*n+n*n*n);
	}

} Main
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;

public class Main {
	
	
	
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		System.out.println(n+n*n+n*n*n);
	}

}
