import java.io.*;
// import java.math.*;
// import java.util.*;
// import java.util.Map.*;
// import java.util.stream.*;

public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int a = Integer.parseInt (reader.readLine());
        System.out.println (
            String.format ("%.0f", a + Math.pow (a, 2) + Math.pow (a, 3)));
        return;
    }
} import java.io.*; io.* java public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int a = Integer.parseInt (reader.readLine());
        System.out.println (
            String.format ("%.0f", a + Math.pow (a, 2) + Math.pow (a, 3)));
        return;
    }
} Main public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int a = Integer.parseInt (reader.readLine());
        System.out.println (
            String.format ("%.0f", a + Math.pow (a, 2) + Math.pow (a, 3)));
        return;
    } main {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int a = Integer.parseInt (reader.readLine());
        System.out.println (
            String.format ("%.0f", a + Math.pow (a, 2) + Math.pow (a, 3)));
        return;
    } BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in)); reader new BufferedReader (new InputStreamReader (System.in)) int a = Integer.parseInt (reader.readLine()); a Integer.parseInt (reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader System.out.println (
            String.format ("%.0f", a + Math.pow (a, 2) + Math.pow (a, 3))) System.out.println System.out System System.out String.format ("%.0f", a + Math.pow (a, 2) + Math.pow (a, 3)) String.format String "%.0f" a + Math.pow (a, 2) + Math.pow (a, 3) a + Math.pow (a, 2) + Math.pow (a, 3) a Math.pow (a, 2) Math.pow Math a 2 Math.pow (a, 3) Math.pow Math a 3 return; String[] args args public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int a = Integer.parseInt (reader.readLine());
        System.out.println (
            String.format ("%.0f", a + Math.pow (a, 2) + Math.pow (a, 3)));
        return;
    }
} public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int a = Integer.parseInt (reader.readLine());
        System.out.println (
            String.format ("%.0f", a + Math.pow (a, 2) + Math.pow (a, 3)));
        return;
    }
} Main
import java.io.*;
// import java.math.*;
// import java.util.*;
// import java.util.Map.*;
// import java.util.stream.*;

public class Main {
    public static void main (String[] args) throws Exception {
        BufferedReader reader =
            new BufferedReader (new InputStreamReader (System.in));
        int a = Integer.parseInt (reader.readLine());
        System.out.println (
            String.format ("%.0f", a + Math.pow (a, 2) + Math.pow (a, 3)));
        return;
    }
}