import java.util.*;
import java.io.*;
class Main{
  public static void main(String[] args){
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int a = Integer.parseInt(br.readLine());
      int ans = a + (int)Math.pow(a,2) + (int)Math.pow(a,3);
      System.out.println(ans);
    }catch(IOException e){
       System.out.println(e);
    }
  }
} import java.util.*; util.* java import java.io.*; io.* java class Main{
  public static void main(String[] args){
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int a = Integer.parseInt(br.readLine());
      int ans = a + (int)Math.pow(a,2) + (int)Math.pow(a,3);
      System.out.println(ans);
    }catch(IOException e){
       System.out.println(e);
    }
  }
} Main public static void main(String[] args){
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int a = Integer.parseInt(br.readLine());
      int ans = a + (int)Math.pow(a,2) + (int)Math.pow(a,3);
      System.out.println(ans);
    }catch(IOException e){
       System.out.println(e);
    }
  } main {
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int a = Integer.parseInt(br.readLine());
      int ans = a + (int)Math.pow(a,2) + (int)Math.pow(a,3);
      System.out.println(ans);
    }catch(IOException e){
       System.out.println(e);
    }
  } try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int a = Integer.parseInt(br.readLine());
      int ans = a + (int)Math.pow(a,2) + (int)Math.pow(a,3);
      System.out.println(ans);
    }catch(IOException e){
       System.out.println(e);
    } catch(IOException e){
       System.out.println(e);
    } IOException e {
       System.out.println(e);
    } System.out.println(e) System.out.println System.out System System.out e {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int a = Integer.parseInt(br.readLine());
      int ans = a + (int)Math.pow(a,2) + (int)Math.pow(a,3);
      System.out.println(ans);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int a = Integer.parseInt(br.readLine()); a Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int ans = a + (int)Math.pow(a,2) + (int)Math.pow(a,3); ans a + (int)Math.pow(a,2) + (int)Math.pow(a,3) a + (int)Math.pow(a,2) + (int)Math.pow(a,3) a (int)Math.pow(a,2) Math.pow Math a 2 (int)Math.pow(a,3) Math.pow Math a 3 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;
import java.io.*;
class Main{
  public static void main(String[] args){
    try{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      int a = Integer.parseInt(br.readLine());
      int ans = a + (int)Math.pow(a,2) + (int)Math.pow(a,3);
      System.out.println(ans);
    }catch(IOException e){
       System.out.println(e);
    }
  }
}