import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int s = kb.nextInt();
		System.out.println((int) (s + Math.pow(s, 2) + Math.pow(s, 3)));
		kb.close();
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int s = kb.nextInt();
		System.out.println((int) (s + Math.pow(s, 2) + Math.pow(s, 3)));
		kb.close();
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int s = kb.nextInt();
		System.out.println((int) (s + Math.pow(s, 2) + Math.pow(s, 3)));
		kb.close();
	} main {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int s = kb.nextInt();
		System.out.println((int) (s + Math.pow(s, 2) + Math.pow(s, 3)));
		kb.close();
	} Scanner kb = new Scanner(System.in); kb new Scanner(System.in) int s = kb.nextInt(); s kb.nextInt() kb.nextInt kb System.out.println((int) (s + Math.pow(s, 2) + Math.pow(s, 3))) System.out.println System.out System System.out (int) (s + Math.pow(s, 2) + Math.pow(s, 3)) s + Math.pow(s, 2) + Math.pow(s, 3) s Math.pow(s, 2) Math.pow Math s 2 Math.pow(s, 3) Math.pow Math s 3 kb.close() kb.close kb String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int s = kb.nextInt();
		System.out.println((int) (s + Math.pow(s, 2) + Math.pow(s, 3)));
		kb.close();
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int s = kb.nextInt();
		System.out.println((int) (s + Math.pow(s, 2) + Math.pow(s, 3)));
		kb.close();
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int s = kb.nextInt();
		System.out.println((int) (s + Math.pow(s, 2) + Math.pow(s, 3)));
		kb.close();
	}

}
