import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int aa = a*a;
      int aaa = a*a*a;
      int xxx = (a+aa+aaa);
      System.out.print(xxx);
    }
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int aa = a*a;
      int aaa = a*a*a;
      int xxx = (a+aa+aaa);
      System.out.print(xxx);
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int aa = a*a;
      int aaa = a*a*a;
      int xxx = (a+aa+aaa);
      System.out.print(xxx);
    } main {
		Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int aa = a*a;
      int aaa = a*a*a;
      int xxx = (a+aa+aaa);
      System.out.print(xxx);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int aa = a*a; aa a*a a a int aaa = a*a*a; aaa a*a*a a*a*a a a a int xxx = (a+aa+aaa); xxx (a+aa+aaa) a+aa+aaa a aa aaa System.out.print(xxx) System.out.print System.out System System.out xxx String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int aa = a*a;
      int aaa = a*a*a;
      int xxx = (a+aa+aaa);
      System.out.print(xxx);
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int aa = a*a;
      int aaa = a*a*a;
      int xxx = (a+aa+aaa);
      System.out.print(xxx);
    }
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();
      int aa = a*a;
      int aaa = a*a*a;
      int xxx = (a+aa+aaa);
      System.out.print(xxx);
    }
}