import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int a = Integer.parseInt(in.readLine());
    System.out.println(a + (int)Math.pow(a,2) + (int)Math.pow(a,3));
  }
} 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 in = new BufferedReader(new InputStreamReader(System.in));
    int a = Integer.parseInt(in.readLine());
    System.out.println(a + (int)Math.pow(a,2) + (int)Math.pow(a,3));
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int a = Integer.parseInt(in.readLine());
    System.out.println(a + (int)Math.pow(a,2) + (int)Math.pow(a,3));
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int a = Integer.parseInt(in.readLine());
    System.out.println(a + (int)Math.pow(a,2) + (int)Math.pow(a,3));
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) int a = Integer.parseInt(in.readLine()); a Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in System.out.println(a + (int)Math.pow(a,2) + (int)Math.pow(a,3)) System.out.println System.out System System.out a + (int)Math.pow(a,2) + (int)Math.pow(a,3) a + (int)Math.pow(a,2) + (int)Math.pow(a,3) a (int)Math.pow(a,2) Math.pow Math a 2 (int)Math.pow(a,3) Math.pow Math a 3 String[] args args public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int a = Integer.parseInt(in.readLine());
    System.out.println(a + (int)Math.pow(a,2) + (int)Math.pow(a,3));
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int a = Integer.parseInt(in.readLine());
    System.out.println(a + (int)Math.pow(a,2) + (int)Math.pow(a,3));
  }
} 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 in = new BufferedReader(new InputStreamReader(System.in));
    int a = Integer.parseInt(in.readLine());
    System.out.println(a + (int)Math.pow(a,2) + (int)Math.pow(a,3));
  }
}