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

public class Main {

    public static void main (String [] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        //--------------------------START CODING HERE-----------------------------

        String  line= f.readLine();

        int DA = Integer.parseInt(line);

        System.out.print((int)(Math.pow(DA,3)+Math.pow(DA,2)+Math.pow(DA,1)));

        out.close();
    }
} import java.io.*; io.* java import java.util.StringTokenizer; StringTokenizer java.util public class Main {

    public static void main (String [] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        //--------------------------START CODING HERE-----------------------------

        String  line= f.readLine();

        int DA = Integer.parseInt(line);

        System.out.print((int)(Math.pow(DA,3)+Math.pow(DA,2)+Math.pow(DA,1)));

        out.close();
    }
} Main public static void main (String [] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        //--------------------------START CODING HERE-----------------------------

        String  line= f.readLine();

        int DA = Integer.parseInt(line);

        System.out.print((int)(Math.pow(DA,3)+Math.pow(DA,2)+Math.pow(DA,1)));

        out.close();
    } main {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        //--------------------------START CODING HERE-----------------------------

        String  line= f.readLine();

        int DA = Integer.parseInt(line);

        System.out.print((int)(Math.pow(DA,3)+Math.pow(DA,2)+Math.pow(DA,1)));

        out.close();
    } BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); f new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) String  line= f.readLine(); line f.readLine() f.readLine f int DA = Integer.parseInt(line); DA Integer.parseInt(line) Integer.parseInt Integer line System.out.print((int)(Math.pow(DA,3)+Math.pow(DA,2)+Math.pow(DA,1))) System.out.print System.out System System.out (int)(Math.pow(DA,3)+Math.pow(DA,2)+Math.pow(DA,1)) Math.pow(DA,3)+Math.pow(DA,2)+Math.pow(DA,1) Math.pow(DA,3) Math.pow Math DA 3 Math.pow(DA,2) Math.pow Math DA 2 Math.pow(DA,1) Math.pow Math DA 1 out.close() out.close out String [] args args public class Main {

    public static void main (String [] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        //--------------------------START CODING HERE-----------------------------

        String  line= f.readLine();

        int DA = Integer.parseInt(line);

        System.out.print((int)(Math.pow(DA,3)+Math.pow(DA,2)+Math.pow(DA,1)));

        out.close();
    }
} public class Main {

    public static void main (String [] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        //--------------------------START CODING HERE-----------------------------

        String  line= f.readLine();

        int DA = Integer.parseInt(line);

        System.out.print((int)(Math.pow(DA,3)+Math.pow(DA,2)+Math.pow(DA,1)));

        out.close();
    }
} Main
import java.io.*;
import java.util.StringTokenizer;

public class Main {

    public static void main (String [] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        //--------------------------START CODING HERE-----------------------------

        String  line= f.readLine();

        int DA = Integer.parseInt(line);

        System.out.print((int)(Math.pow(DA,3)+Math.pow(DA,2)+Math.pow(DA,1)));

        out.close();
    }
}