import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		String ans = ""+ (int) (N + Math.pow(N, 2) + Math.pow(N, 3));
		System.out.println(ans);
	}
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		String ans = ""+ (int) (N + Math.pow(N, 2) + Math.pow(N, 3));
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		String ans = ""+ (int) (N + Math.pow(N, 2) + Math.pow(N, 3));
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		String ans = ""+ (int) (N + Math.pow(N, 2) + Math.pow(N, 3));
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc sc.close() sc.close sc String ans = ""+ (int) (N + Math.pow(N, 2) + Math.pow(N, 3)); ans ""+ (int) (N + Math.pow(N, 2) + Math.pow(N, 3)) "" (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 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		String ans = ""+ (int) (N + Math.pow(N, 2) + Math.pow(N, 3));
		System.out.println(ans);
	}
}
