import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        sc.close();

        long ret = (long) (a + Math.pow(a, 2) + Math.pow(a, 3));

        System.out.println(ret);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        sc.close();

        long ret = (long) (a + Math.pow(a, 2) + Math.pow(a, 3));

        System.out.println(ret);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        sc.close();

        long ret = (long) (a + Math.pow(a, 2) + Math.pow(a, 3));

        System.out.println(ret);
    } main {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        sc.close();

        long ret = (long) (a + Math.pow(a, 2) + Math.pow(a, 3));

        System.out.println(ret);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double a = sc.nextDouble(); a sc.nextDouble() sc.nextDouble sc sc.close() sc.close sc long ret = (long) (a + Math.pow(a, 2) + Math.pow(a, 3)); ret (long) (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 System.out.println(ret) System.out.println System.out System System.out ret String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        sc.close();

        long ret = (long) (a + Math.pow(a, 2) + Math.pow(a, 3));

        System.out.println(ret);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        sc.close();

        long ret = (long) (a + Math.pow(a, 2) + Math.pow(a, 3));

        System.out.println(ret);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        sc.close();

        long ret = (long) (a + Math.pow(a, 2) + Math.pow(a, 3));

        System.out.println(ret);
    }
}
