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