import java.util.*;
import java.io.*;
class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    PrintWriter out = new PrintWriter(System.out);
    out.print((int)(A + Math.pow(A,2)+ Math.pow(A,3)));
    out.flush();
  }
} import java.util.*; util.* java import java.io.*; io.* java class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    PrintWriter out = new PrintWriter(System.out);
    out.print((int)(A + Math.pow(A,2)+ Math.pow(A,3)));
    out.flush();
  }
} Main public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    PrintWriter out = new PrintWriter(System.out);
    out.print((int)(A + Math.pow(A,2)+ Math.pow(A,3)));
    out.flush();
  } main {
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    PrintWriter out = new PrintWriter(System.out);
    out.print((int)(A + Math.pow(A,2)+ Math.pow(A,3)));
    out.flush();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) out.print((int)(A + Math.pow(A,2)+ Math.pow(A,3))) out.print out (int)(A + Math.pow(A,2)+ Math.pow(A,3)) A + Math.pow(A,2)+ Math.pow(A,3) A Math.pow(A,2) Math.pow Math A 2 Math.pow(A,3) Math.pow Math A 3 out.flush() out.flush out String args[] args
import java.util.*;
import java.io.*;
class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int A = Integer.parseInt(sc.next());
    PrintWriter out = new PrintWriter(System.out);
    out.print((int)(A + Math.pow(A,2)+ Math.pow(A,3)));
    out.flush();
  }
}