import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int a2 =  a*a;
      int a3 =  a*a*a;
      int ans = a+a2+a3;
      System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int a2 =  a*a;
      int a3 =  a*a*a;
      int ans = a+a2+a3;
      System.out.println(ans);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int a2 =  a*a;
      int a3 =  a*a*a;
      int ans = a+a2+a3;
      System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int a2 =  a*a;
      int a3 =  a*a*a;
      int ans = a+a2+a3;
      System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int a2 =  a*a; a2 a*a a a int a3 =  a*a*a; a3 a*a*a a*a*a a a a int ans = a+a2+a3; ans a+a2+a3 a+a2+a3 a a2 a3 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int a2 =  a*a;
      int a3 =  a*a*a;
      int ans = a+a2+a3;
      System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int a2 =  a*a;
      int a3 =  a*a*a;
      int ans = a+a2+a3;
      System.out.println(ans);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int a2 =  a*a;
      int a3 =  a*a*a;
      int ans = a+a2+a3;
      System.out.println(ans);
	}
}