import java.lang.*;
import java.util.*;

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

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