import java.util.*;
 
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double a = sc.nextInt();
    int a2 = (int)Math.pow(a, 2);
    int a3 = (int)Math.pow(a, 3);
    int ans = (int)(a+a2+a3);
    System.out.println(ans);
    
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double a = sc.nextInt();
    int a2 = (int)Math.pow(a, 2);
    int a3 = (int)Math.pow(a, 3);
    int ans = (int)(a+a2+a3);
    System.out.println(ans);
    
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double a = sc.nextInt();
    int a2 = (int)Math.pow(a, 2);
    int a3 = (int)Math.pow(a, 3);
    int ans = (int)(a+a2+a3);
    System.out.println(ans);
    
  } main {
    Scanner sc = new Scanner(System.in);
    double a = sc.nextInt();
    int a2 = (int)Math.pow(a, 2);
    int a3 = (int)Math.pow(a, 3);
    int ans = (int)(a+a2+a3);
    System.out.println(ans);
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int a2 = (int)Math.pow(a, 2); a2 (int)Math.pow(a, 2) Math.pow Math a 2 int a3 = (int)Math.pow(a, 3); a3 (int)Math.pow(a, 3) Math.pow Math a 3 int ans = (int)(a+a2+a3); ans (int)(a+a2+a3) a+a2+a3 a a2 a3 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;
 
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    double a = sc.nextInt();
    int a2 = (int)Math.pow(a, 2);
    int a3 = (int)Math.pow(a, 3);
    int ans = (int)(a+a2+a3);
    System.out.println(ans);
    
  }
}