import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		
		int b = (int)Math.pow(a, 2);
		int c = (int)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 scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		
		int b = (int)Math.pow(a, 2);
		int c = (int)Math.pow(a, 3);
		
		System.out.println(a+b+c);
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		
		int b = (int)Math.pow(a, 2);
		int c = (int)Math.pow(a, 3);
		
		System.out.println(a+b+c);
	} main {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		
		int b = (int)Math.pow(a, 2);
		int c = (int)Math.pow(a, 3);
		
		System.out.println(a+b+c);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = (int)Math.pow(a, 2); b (int)Math.pow(a, 2) Math.pow Math a 2 int c = (int)Math.pow(a, 3); c (int)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 scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		
		int b = (int)Math.pow(a, 2);
		int c = (int)Math.pow(a, 3);
		
		System.out.println(a+b+c);
	}
} public class Main {

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

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		int a = scan.nextInt();
		
		int b = (int)Math.pow(a, 2);
		int c = (int)Math.pow(a, 3);
		
		System.out.println(a+b+c);
	}
}
 
