import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	static ArrayList<String> strList = new ArrayList<String>();
	static ArrayList<String> strList2 = new ArrayList<String>();
	static ArrayList<Integer> intList = new ArrayList<Integer>();
	static HashMap<String,Integer> Hmap = new HashMap<String,Integer>();
	public static void main(String[] args) {

		String str = sc.next();
		int a1,a2,a3;
		int ans;

		a1 = Integer.parseInt(str);
      
		a2 = a1*a1;
		a3 = a1*a1*a1;

		ans = a1+a2+a3;
		System.out.println(ans);

	}

}
 import java.util.*; util.* java public class Main {
	static Scanner sc = new Scanner(System.in);
	static ArrayList<String> strList = new ArrayList<String>();
	static ArrayList<String> strList2 = new ArrayList<String>();
	static ArrayList<Integer> intList = new ArrayList<Integer>();
	static HashMap<String,Integer> Hmap = new HashMap<String,Integer>();
	public static void main(String[] args) {

		String str = sc.next();
		int a1,a2,a3;
		int ans;

		a1 = Integer.parseInt(str);
      
		a2 = a1*a1;
		a3 = a1*a1*a1;

		ans = a1+a2+a3;
		System.out.println(ans);

	}

} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static ArrayList<String> strList = new ArrayList<String>(); strList new ArrayList<String>() static ArrayList<String> strList2 = new ArrayList<String>(); strList2 new ArrayList<String>() static ArrayList<Integer> intList = new ArrayList<Integer>(); intList new ArrayList<Integer>() static HashMap<String,Integer> Hmap = new HashMap<String,Integer>(); Hmap new HashMap<String,Integer>() public static void main(String[] args) {

		String str = sc.next();
		int a1,a2,a3;
		int ans;

		a1 = Integer.parseInt(str);
      
		a2 = a1*a1;
		a3 = a1*a1*a1;

		ans = a1+a2+a3;
		System.out.println(ans);

	} main {

		String str = sc.next();
		int a1,a2,a3;
		int ans;

		a1 = Integer.parseInt(str);
      
		a2 = a1*a1;
		a3 = a1*a1*a1;

		ans = a1+a2+a3;
		System.out.println(ans);

	} String str = sc.next(); str sc.next() sc.next sc int a1 a1 a2 a2 a3; a3 int ans; ans a1 = Integer.parseInt(str) a1 Integer.parseInt(str) Integer.parseInt Integer str a2 = a1*a1 a2 a1*a1 a1 a1 a3 = a1*a1*a1 a3 a1*a1*a1 a1*a1*a1 a1 a1 a1 ans = a1+a2+a3 ans a1+a2+a3 a1+a2+a3 a1 a2 a3 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	static Scanner sc = new Scanner(System.in);
	static ArrayList<String> strList = new ArrayList<String>();
	static ArrayList<String> strList2 = new ArrayList<String>();
	static ArrayList<Integer> intList = new ArrayList<Integer>();
	static HashMap<String,Integer> Hmap = new HashMap<String,Integer>();
	public static void main(String[] args) {

		String str = sc.next();
		int a1,a2,a3;
		int ans;

		a1 = Integer.parseInt(str);
      
		a2 = a1*a1;
		a3 = a1*a1*a1;

		ans = a1+a2+a3;
		System.out.println(ans);

	}

} public class Main {
	static Scanner sc = new Scanner(System.in);
	static ArrayList<String> strList = new ArrayList<String>();
	static ArrayList<String> strList2 = new ArrayList<String>();
	static ArrayList<Integer> intList = new ArrayList<Integer>();
	static HashMap<String,Integer> Hmap = new HashMap<String,Integer>();
	public static void main(String[] args) {

		String str = sc.next();
		int a1,a2,a3;
		int ans;

		a1 = Integer.parseInt(str);
      
		a2 = a1*a1;
		a3 = a1*a1*a1;

		ans = a1+a2+a3;
		System.out.println(ans);

	}

} Main
import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	static ArrayList<String> strList = new ArrayList<String>();
	static ArrayList<String> strList2 = new ArrayList<String>();
	static ArrayList<Integer> intList = new ArrayList<Integer>();
	static HashMap<String,Integer> Hmap = new HashMap<String,Integer>();
	public static void main(String[] args) {

		String str = sc.next();
		int a1,a2,a3;
		int ans;

		a1 = Integer.parseInt(str);
      
		a2 = a1*a1;
		a3 = a1*a1*a1;

		ans = a1+a2+a3;
		System.out.println(ans);

	}

}

