import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = (long)Math.pow(a, 2);
		long c = (long)Math.pow(a, 3);
		System.out.println(a + b + c);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = (long)Math.pow(a, 2);
		long c = (long)Math.pow(a, 3);
		System.out.println(a + b + c);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = (long)Math.pow(a, 2);
		long c = (long)Math.pow(a, 3);
		System.out.println(a + b + c);
	} main {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = (long)Math.pow(a, 2);
		long c = (long)Math.pow(a, 3);
		System.out.println(a + b + c);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc long b = (long)Math.pow(a, 2); b (long)Math.pow(a, 2) Math.pow Math a 2 long c = (long)Math.pow(a, 3); c (long)Math.pow(a, 3) Math.pow Math a 3 System.out.println(a + b + c) System.out.println System.out System System.out a + b + c a + b + c a b c String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = (long)Math.pow(a, 2);
		long c = (long)Math.pow(a, 3);
		System.out.println(a + b + c);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = (long)Math.pow(a, 2);
		long c = (long)Math.pow(a, 3);
		System.out.println(a + b + c);
	}
} Main
import java.util.*;

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