import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int result = 0;

        result = a + (a * a) + (a * a * a);

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);

        sc.close();
        out.flush();
    }
} import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int result = 0;

        result = a + (a * a) + (a * a * a);

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);

        sc.close();
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int result = 0;

        result = a + (a * a) + (a * a * a);

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);

        sc.close();
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int result = 0;

        result = a + (a * a) + (a * a * a);

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);

        sc.close();
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int result = 0; result 0 result = a + (a * a) + (a * a * a) result 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 PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) out.println(result) out.println out result sc.close() sc.close sc out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int result = 0;

        result = a + (a * a) + (a * a * a);

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);

        sc.close();
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int result = 0;

        result = a + (a * a) + (a * a * a);

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);

        sc.close();
        out.flush();
    }
} Main
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int result = 0;

        result = a + (a * a) + (a * a * a);

        PrintWriter out = new PrintWriter(System.out);
        out.println(result);

        sc.close();
        out.flush();
    }
}