import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
 public static void main(String[] args) throws IOException {
   BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
   int a = Integer.parseInt(reader.readLine());
   long result = a + a * a + a * a * a;
   System.out.println(result);
 }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
 public static void main(String[] args) throws IOException {
   BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
   int a = Integer.parseInt(reader.readLine());
   long result = a + a * a + a * a * a;
   System.out.println(result);
 }
} Main public static void main(String[] args) throws IOException {
   BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
   int a = Integer.parseInt(reader.readLine());
   long result = a + a * a + a * a * a;
   System.out.println(result);
 } main {
   BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
   int a = Integer.parseInt(reader.readLine());
   long result = a + a * a + a * a * a;
   System.out.println(result);
 } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) int a = Integer.parseInt(reader.readLine()); a Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader long result = a + a * a + a * a * a; result 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(result) System.out.println System.out System System.out result String[] args args public class Main {
 public static void main(String[] args) throws IOException {
   BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
   int a = Integer.parseInt(reader.readLine());
   long result = a + a * a + a * a * a;
   System.out.println(result);
 }
} public class Main {
 public static void main(String[] args) throws IOException {
   BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
   int a = Integer.parseInt(reader.readLine());
   long result = a + a * a + a * a * a;
   System.out.println(result);
 }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Main {
 public static void main(String[] args) throws IOException {
   BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
   int a = Integer.parseInt(reader.readLine());
   long result = a + a * a + a * a * a;
   System.out.println(result);
 }
}
