import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

  static int a;

  public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    String[] in = br.readLine().split(" ");
    a = Integer.parseInt(in[0]);

    br.close();

    out.println(a + a*a + a*a*a);

    out.flush();

  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {

  static int a;

  public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    String[] in = br.readLine().split(" ");
    a = Integer.parseInt(in[0]);

    br.close();

    out.println(a + a*a + a*a*a);

    out.flush();

  }
} Main static int a; a public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    String[] in = br.readLine().split(" ");
    a = Integer.parseInt(in[0]);

    br.close();

    out.println(a + a*a + a*a*a);

    out.flush();

  } main {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    String[] in = br.readLine().split(" ");
    a = Integer.parseInt(in[0]);

    br.close();

    out.println(a + a*a + a*a*a);

    out.flush();

  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) String[] in = br.readLine().split(" "); in br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " a = Integer.parseInt(in[0]) a Integer.parseInt(in[0]) Integer.parseInt Integer in[0] in 0 br.close() br.close br out.println(a + a*a + a*a*a) out.println out 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 out.flush() out.flush out String[] args args public class Main {

  static int a;

  public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    String[] in = br.readLine().split(" ");
    a = Integer.parseInt(in[0]);

    br.close();

    out.println(a + a*a + a*a*a);

    out.flush();

  }
} public class Main {

  static int a;

  public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    String[] in = br.readLine().split(" ");
    a = Integer.parseInt(in[0]);

    br.close();

    out.println(a + a*a + a*a*a);

    out.flush();

  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

  static int a;

  public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    String[] in = br.readLine().split(" ");
    a = Integer.parseInt(in[0]);

    br.close();

    out.println(a + a*a + a*a*a);

    out.flush();

  }
}