public class Main {
  public static void main(String[] args) {
    int a = new java.util.Scanner(System.in).nextInt();
    int b = a + a * a + a * a * a;
    System.out.println(b);
  }
} public class Main {
  public static void main(String[] args) {
    int a = new java.util.Scanner(System.in).nextInt();
    int b = a + a * a + a * a * a;
    System.out.println(b);
  }
} Main public static void main(String[] args) {
    int a = new java.util.Scanner(System.in).nextInt();
    int b = a + a * a + a * a * a;
    System.out.println(b);
  } main {
    int a = new java.util.Scanner(System.in).nextInt();
    int b = a + a * a + a * a * a;
    System.out.println(b);
  } int a = new java.util.Scanner(System.in).nextInt(); a new java.util.Scanner(System.in).nextInt() new java.util.Scanner(System.in).nextInt new java.util.Scanner(System.in) int b = a + a * a + a * a * a; b 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.println(b) System.out.println System.out System System.out b String[] args args public class Main {
  public static void main(String[] args) {
    int a = new java.util.Scanner(System.in).nextInt();
    int b = a + a * a + a * a * a;
    System.out.println(b);
  }
} public class Main {
  public static void main(String[] args) {
    int a = new java.util.Scanner(System.in).nextInt();
    int b = a + a * a + a * a * a;
    System.out.println(b);
  }
} Main
public class Main {
  public static void main(String[] args) {
    int a = new java.util.Scanner(System.in).nextInt();
    int b = a + a * a + a * a * a;
    System.out.println(b);
  }
}
