import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Arrays;
import java.util.Collections;
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = a * a;
    int c = b * a;
    System.out.println(a + b + c);
  }
} import java.util.Scanner; Scanner java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Comparator; Comparator java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = a * a;
    int c = b * a;
    System.out.println(a + b + c);
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = a * a;
    int c = b * a;
    System.out.println(a + b + c);
  } main {
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = a * a;
    int c = b * a;
    System.out.println(a + b + c);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = a * a; b a * a a a int c = b * a; c b * a b a System.out.println(a + b + c) System.out.println System.out System System.out a + b + c a + b + c a b c String[] args args
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Arrays;
import java.util.Collections;
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    int b = a * a;
    int c = b * a;
    System.out.println(a + b + c);
  }
}
