import java.util.Scanner;

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

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		System.out.println((long) (N + Math.pow(N, 2) + Math.pow(N, 3)));
	}
}