import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    
        int a = Integer.parseInt(br.readLine());
         
        out.println(a + a * a + a * a * a);
        out.close();
        
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    
        int a = Integer.parseInt(br.readLine());
         
        out.println(a + a * a + a * a * a);
        out.close();
        
    }
} Main public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    
        int a = Integer.parseInt(br.readLine());
         
        out.println(a + a * a + a * a * a);
        out.close();
        
    } main {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    
        int a = Integer.parseInt(br.readLine());
         
        out.println(a + a * a + a * a * a);
        out.close();
        
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); out new PrintWriter(new OutputStreamWriter(System.out)) int a = Integer.parseInt(br.readLine()); a Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br out.println(a + a * a + a * a * a) out.println out a + a * a + a * a * a a + a * a + a * a * a a a * a a a a * a * a a * a * a a a a out.close() out.close out String[] args args public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    
        int a = Integer.parseInt(br.readLine());
         
        out.println(a + a * a + a * a * a);
        out.close();
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    
        int a = Integer.parseInt(br.readLine());
         
        out.println(a + a * a + a * a * a);
        out.close();
        
    }
} Main
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {

        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    
        int a = Integer.parseInt(br.readLine());
         
        out.println(a + a * a + a * a * a);
        out.close();
        
    }
}