import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
 	public static void main(String[] args) {
     	Scanner sc = new Scanner(System.in);
      	int a = sc.nextInt();
      	int val = a + (a*a) + (a*a*a);
      	System.out.println(val);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
 	public static void main(String[] args) {
     	Scanner sc = new Scanner(System.in);
      	int a = sc.nextInt();
      	int val = a + (a*a) + (a*a*a);
      	System.out.println(val);
    }
} Main public static void main(String[] args) {
     	Scanner sc = new Scanner(System.in);
      	int a = sc.nextInt();
      	int val = a + (a*a) + (a*a*a);
      	System.out.println(val);
    } main {
     	Scanner sc = new Scanner(System.in);
      	int a = sc.nextInt();
      	int val = a + (a*a) + (a*a*a);
      	System.out.println(val);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int val = a + (a*a) + (a*a*a); val a + (a*a) + (a*a*a) a + (a*a) + (a*a*a) a (a*a) a a (a*a*a) a*a*a a a a System.out.println(val) System.out.println System.out System System.out val String[] args args public class Main {
 	public static void main(String[] args) {
     	Scanner sc = new Scanner(System.in);
      	int a = sc.nextInt();
      	int val = a + (a*a) + (a*a*a);
      	System.out.println(val);
    }
} public class Main {
 	public static void main(String[] args) {
     	Scanner sc = new Scanner(System.in);
      	int a = sc.nextInt();
      	int val = a + (a*a) + (a*a*a);
      	System.out.println(val);
    }
} Main
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
 	public static void main(String[] args) {
     	Scanner sc = new Scanner(System.in);
      	int a = sc.nextInt();
      	int val = a + (a*a) + (a*a*a);
      	System.out.println(val);
    }
}