import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
  public static void main(String[] args){
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);
    String str;
    int i=0;
        try {
            str = br.readLine();
            br.close();
		    i=Integer.parseInt(str);
        } catch (IOException e) {
            e.printStackTrace();
        }    
    System.out.println(i+i*i+i*i*i);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main{
  public static void main(String[] args){
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);
    String str;
    int i=0;
        try {
            str = br.readLine();
            br.close();
		    i=Integer.parseInt(str);
        } catch (IOException e) {
            e.printStackTrace();
        }    
    System.out.println(i+i*i+i*i*i);
  }
} Main public static void main(String[] args){
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);
    String str;
    int i=0;
        try {
            str = br.readLine();
            br.close();
		    i=Integer.parseInt(str);
        } catch (IOException e) {
            e.printStackTrace();
        }    
    System.out.println(i+i*i+i*i*i);
  } main {
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);
    String str;
    int i=0;
        try {
            str = br.readLine();
            br.close();
		    i=Integer.parseInt(str);
        } catch (IOException e) {
            e.printStackTrace();
        }    
    System.out.println(i+i*i+i*i*i);
  } InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) String str; str int i=0; i 0 try {
            str = br.readLine();
            br.close();
		    i=Integer.parseInt(str);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } IOException e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            str = br.readLine();
            br.close();
		    i=Integer.parseInt(str);
        } str = br.readLine() str br.readLine() br.readLine br br.close() br.close br i=Integer.parseInt(str) i Integer.parseInt(str) Integer.parseInt Integer str System.out.println(i+i*i+i*i*i) System.out.println System.out System System.out i+i*i+i*i*i i+i*i+i*i*i i i*i i i i*i*i i*i*i i i i String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
  public static void main(String[] args){
    InputStreamReader isr = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(isr);
    String str;
    int i=0;
        try {
            str = br.readLine();
            br.close();
		    i=Integer.parseInt(str);
        } catch (IOException e) {
            e.printStackTrace();
        }    
    System.out.println(i+i*i+i*i*i);
  }
}