import java.util.Scanner;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();

    System.out.println(n + n*n + n*n*n);
  }
} import java.util.Scanner; Scanner java.util import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();

    System.out.println(n + n*n + n*n*n);
  }
} Main public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();

    System.out.println(n + n*n + n*n*n);
  } main {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();

    System.out.println(n + n*n + n*n*n);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan System.out.println(n + n*n + n*n*n) System.out.println System.out System System.out n + n*n + n*n*n n + n*n + n*n*n n n*n n n n*n*n n*n*n n n n String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();

    System.out.println(n + n*n + n*n*n);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();

    System.out.println(n + n*n + n*n*n);
  }
} Main
import java.util.Scanner;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();

    System.out.println(n + n*n + n*n*n);
  }
}
