import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		//String s = sc.next();
		//long n = sc.nextLong();
		//double n = sc.nextDouble();
		
		//for(int i = 0; i < ; i++)

		System.out.println((int)(n+Math.pow(n, 2)+Math.pow(n, 3)));
		//System.out.println("No");
		

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

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		//String s = sc.next();
		//long n = sc.nextLong();
		//double n = sc.nextDouble();
		
		//for(int i = 0; i < ; i++)

		System.out.println((int)(n+Math.pow(n, 2)+Math.pow(n, 3)));
		//System.out.println("No");
		

	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		//String s = sc.next();
		//long n = sc.nextLong();
		//double n = sc.nextDouble();
		
		//for(int i = 0; i < ; i++)

		System.out.println((int)(n+Math.pow(n, 2)+Math.pow(n, 3)));
		//System.out.println("No");
		

	} main {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		//String s = sc.next();
		//long n = sc.nextLong();
		//double n = sc.nextDouble();
		
		//for(int i = 0; i < ; i++)

		System.out.println((int)(n+Math.pow(n, 2)+Math.pow(n, 3)));
		//System.out.println("No");
		

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

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		//String s = sc.next();
		//long n = sc.nextLong();
		//double n = sc.nextDouble();
		
		//for(int i = 0; i < ; i++)

		System.out.println((int)(n+Math.pow(n, 2)+Math.pow(n, 3)));
		//System.out.println("No");
		

	}
} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		//String s = sc.next();
		//long n = sc.nextLong();
		//double n = sc.nextDouble();
		
		//for(int i = 0; i < ; i++)

		System.out.println((int)(n+Math.pow(n, 2)+Math.pow(n, 3)));
		//System.out.println("No");
		

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		//String s = sc.next();
		//long n = sc.nextLong();
		//double n = sc.nextDouble();
		
		//for(int i = 0; i < ; i++)

		System.out.println((int)(n+Math.pow(n, 2)+Math.pow(n, 3)));
		//System.out.println("No");
		

	}
}
