import java.util.Scanner;
import java.lang.Math;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String str_scan = scan.nextLine();
    double ans = Double.parseDouble(str_scan);
    double ans_double;

    ans_double = ans + Math.pow(ans,2) + Math.pow(ans,3);

    System.out.println((int)ans_double);
    scan.close();
  }
} import java.util.Scanner; Scanner java.util import java.lang.Math; Math java.lang public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String str_scan = scan.nextLine();
    double ans = Double.parseDouble(str_scan);
    double ans_double;

    ans_double = ans + Math.pow(ans,2) + Math.pow(ans,3);

    System.out.println((int)ans_double);
    scan.close();
  }
} Main public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String str_scan = scan.nextLine();
    double ans = Double.parseDouble(str_scan);
    double ans_double;

    ans_double = ans + Math.pow(ans,2) + Math.pow(ans,3);

    System.out.println((int)ans_double);
    scan.close();
  } main {
    Scanner scan = new Scanner(System.in);
    String str_scan = scan.nextLine();
    double ans = Double.parseDouble(str_scan);
    double ans_double;

    ans_double = ans + Math.pow(ans,2) + Math.pow(ans,3);

    System.out.println((int)ans_double);
    scan.close();
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str_scan = scan.nextLine(); str_scan scan.nextLine() scan.nextLine scan double ans = Double.parseDouble(str_scan); ans Double.parseDouble(str_scan) Double.parseDouble Double str_scan double ans_double; ans_double ans_double = ans + Math.pow(ans,2) + Math.pow(ans,3) ans_double ans + Math.pow(ans,2) + Math.pow(ans,3) ans + Math.pow(ans,2) + Math.pow(ans,3) ans Math.pow(ans,2) Math.pow Math ans 2 Math.pow(ans,3) Math.pow Math ans 3 System.out.println((int)ans_double) System.out.println System.out System System.out (int)ans_double scan.close() scan.close scan String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String str_scan = scan.nextLine();
    double ans = Double.parseDouble(str_scan);
    double ans_double;

    ans_double = ans + Math.pow(ans,2) + Math.pow(ans,3);

    System.out.println((int)ans_double);
    scan.close();
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String str_scan = scan.nextLine();
    double ans = Double.parseDouble(str_scan);
    double ans_double;

    ans_double = ans + Math.pow(ans,2) + Math.pow(ans,3);

    System.out.println((int)ans_double);
    scan.close();
  }
} Main
import java.util.Scanner;
import java.lang.Math;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String str_scan = scan.nextLine();
    double ans = Double.parseDouble(str_scan);
    double ans_double;

    ans_double = ans + Math.pow(ans,2) + Math.pow(ans,3);

    System.out.println((int)ans_double);
    scan.close();
  }
}