import java.util.Scanner;

class Main {

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

	}

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

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

	}

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

	} main {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int a = scn.nextInt();
		long ans = (long) (a + Math.pow(a, 2) + Math.pow(a, 3));
		System.out.println(ans);

	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int a = scn.nextInt(); a scn.nextInt() scn.nextInt scn long ans = (long) (a + Math.pow(a, 2) + Math.pow(a, 3)); ans (long) (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 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.Scanner;

class Main {

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

	}

}
