import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    int a, ans;
    Scanner sc = new Scanner(System.in);

    a = sc.nextInt();
    sc.close();
    ans = a + a * a + a * a * a;
    System.out.printf("%d", ans);
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    int a, ans;
    Scanner sc = new Scanner(System.in);

    a = sc.nextInt();
    sc.close();
    ans = a + a * a + a * a * a;
    System.out.printf("%d", ans);
  }
} Main public static void main(String[] args) {
    int a, ans;
    Scanner sc = new Scanner(System.in);

    a = sc.nextInt();
    sc.close();
    ans = a + a * a + a * a * a;
    System.out.printf("%d", ans);
  } main {
    int a, ans;
    Scanner sc = new Scanner(System.in);

    a = sc.nextInt();
    sc.close();
    ans = a + a * a + a * a * a;
    System.out.printf("%d", ans);
  } int a a ans; ans Scanner sc = new Scanner(System.in); sc new Scanner(System.in) a = sc.nextInt() a sc.nextInt() sc.nextInt sc sc.close() sc.close sc ans = a + a * a + a * a * a ans 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 System.out.printf("%d", ans) System.out.printf System.out System System.out "%d" ans String[] args args public class Main {
  public static void main(String[] args) {
    int a, ans;
    Scanner sc = new Scanner(System.in);

    a = sc.nextInt();
    sc.close();
    ans = a + a * a + a * a * a;
    System.out.printf("%d", ans);
  }
} public class Main {
  public static void main(String[] args) {
    int a, ans;
    Scanner sc = new Scanner(System.in);

    a = sc.nextInt();
    sc.close();
    ans = a + a * a + a * a * a;
    System.out.printf("%d", ans);
  }
} Main
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    int a, ans;
    Scanner sc = new Scanner(System.in);

    a = sc.nextInt();
    sc.close();
    ans = a + a * a + a * a * a;
    System.out.printf("%d", ans);
  }
}