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