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