import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Object o = run();
        if (o != null)
            System.out.println();
    }

    private static ArrayList<Integer> nScan(Scanner sc, int n) {
        ArrayList<Integer> al = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            al.add(sc.nextInt());
        }
        return al;
    }

    private static Object run() {
        try (Scanner sc = new Scanner(System.in);) {
            int a = sc.nextInt();
            //int a = sc.nextInt();
            //int y = sc.nextInt();
            //int t = sc.next();
            //ArrayList<Integer> x = nScan(sc, n);
            //ArrayList<Integer> y = nScan(sc, n);
            //ArrayList<String> s = nScan(sc, n);
            //for (int i = 0; i < ?; i++) {
            //
            //}
            System.out.println((int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3)));
            return null;
        }
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Object o = run();
        if (o != null)
            System.out.println();
    }

    private static ArrayList<Integer> nScan(Scanner sc, int n) {
        ArrayList<Integer> al = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            al.add(sc.nextInt());
        }
        return al;
    }

    private static Object run() {
        try (Scanner sc = new Scanner(System.in);) {
            int a = sc.nextInt();
            //int a = sc.nextInt();
            //int y = sc.nextInt();
            //int t = sc.next();
            //ArrayList<Integer> x = nScan(sc, n);
            //ArrayList<Integer> y = nScan(sc, n);
            //ArrayList<String> s = nScan(sc, n);
            //for (int i = 0; i < ?; i++) {
            //
            //}
            System.out.println((int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3)));
            return null;
        }
    }
} Main public static void main(String[] args) {
        Object o = run();
        if (o != null)
            System.out.println();
    } main {
        Object o = run();
        if (o != null)
            System.out.println();
    } Object o = run(); o run() run if (o != null)
            System.out.println(); o != null o null System.out.println() System.out.println System.out System System.out String[] args args private static ArrayList<Integer> nScan(Scanner sc, int n) {
        ArrayList<Integer> al = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            al.add(sc.nextInt());
        }
        return al;
    } nScan {
        ArrayList<Integer> al = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            al.add(sc.nextInt());
        }
        return al;
    } ArrayList<Integer> al = new ArrayList<>(); al new ArrayList<>() for (int i = 0; i < n; i++) {
            al.add(sc.nextInt());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            al.add(sc.nextInt());
        } {
            al.add(sc.nextInt());
        } al.add(sc.nextInt()) al.add al sc.nextInt() sc.nextInt sc return al; al Scanner sc sc int n n private static Object run() {
        try (Scanner sc = new Scanner(System.in);) {
            int a = sc.nextInt();
            //int a = sc.nextInt();
            //int y = sc.nextInt();
            //int t = sc.next();
            //ArrayList<Integer> x = nScan(sc, n);
            //ArrayList<Integer> y = nScan(sc, n);
            //ArrayList<String> s = nScan(sc, n);
            //for (int i = 0; i < ?; i++) {
            //
            //}
            System.out.println((int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3)));
            return null;
        }
    } run {
        try (Scanner sc = new Scanner(System.in);) {
            int a = sc.nextInt();
            //int a = sc.nextInt();
            //int y = sc.nextInt();
            //int t = sc.next();
            //ArrayList<Integer> x = nScan(sc, n);
            //ArrayList<Integer> y = nScan(sc, n);
            //ArrayList<String> s = nScan(sc, n);
            //for (int i = 0; i < ?; i++) {
            //
            //}
            System.out.println((int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3)));
            return null;
        }
    } try (Scanner sc = new Scanner(System.in);) {
            int a = sc.nextInt();
            //int a = sc.nextInt();
            //int y = sc.nextInt();
            //int t = sc.next();
            //ArrayList<Integer> x = nScan(sc, n);
            //ArrayList<Integer> y = nScan(sc, n);
            //ArrayList<String> s = nScan(sc, n);
            //for (int i = 0; i < ?; i++) {
            //
            //}
            System.out.println((int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3)));
            return null;
        } {
            int a = sc.nextInt();
            //int a = sc.nextInt();
            //int y = sc.nextInt();
            //int t = sc.next();
            //ArrayList<Integer> x = nScan(sc, n);
            //ArrayList<Integer> y = nScan(sc, n);
            //ArrayList<String> s = nScan(sc, n);
            //for (int i = 0; i < ?; i++) {
            //
            //}
            System.out.println((int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3)));
            return null;
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc System.out.println((int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3))) System.out.println System.out System System.out (int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3)) Math.floor Math 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 null; null public class Main {
    public static void main(String[] args) {
        Object o = run();
        if (o != null)
            System.out.println();
    }

    private static ArrayList<Integer> nScan(Scanner sc, int n) {
        ArrayList<Integer> al = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            al.add(sc.nextInt());
        }
        return al;
    }

    private static Object run() {
        try (Scanner sc = new Scanner(System.in);) {
            int a = sc.nextInt();
            //int a = sc.nextInt();
            //int y = sc.nextInt();
            //int t = sc.next();
            //ArrayList<Integer> x = nScan(sc, n);
            //ArrayList<Integer> y = nScan(sc, n);
            //ArrayList<String> s = nScan(sc, n);
            //for (int i = 0; i < ?; i++) {
            //
            //}
            System.out.println((int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3)));
            return null;
        }
    }
} public class Main {
    public static void main(String[] args) {
        Object o = run();
        if (o != null)
            System.out.println();
    }

    private static ArrayList<Integer> nScan(Scanner sc, int n) {
        ArrayList<Integer> al = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            al.add(sc.nextInt());
        }
        return al;
    }

    private static Object run() {
        try (Scanner sc = new Scanner(System.in);) {
            int a = sc.nextInt();
            //int a = sc.nextInt();
            //int y = sc.nextInt();
            //int t = sc.next();
            //ArrayList<Integer> x = nScan(sc, n);
            //ArrayList<Integer> y = nScan(sc, n);
            //ArrayList<String> s = nScan(sc, n);
            //for (int i = 0; i < ?; i++) {
            //
            //}
            System.out.println((int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3)));
            return null;
        }
    }
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Object o = run();
        if (o != null)
            System.out.println();
    }

    private static ArrayList<Integer> nScan(Scanner sc, int n) {
        ArrayList<Integer> al = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            al.add(sc.nextInt());
        }
        return al;
    }

    private static Object run() {
        try (Scanner sc = new Scanner(System.in);) {
            int a = sc.nextInt();
            //int a = sc.nextInt();
            //int y = sc.nextInt();
            //int t = sc.next();
            //ArrayList<Integer> x = nScan(sc, n);
            //ArrayList<Integer> y = nScan(sc, n);
            //ArrayList<String> s = nScan(sc, n);
            //for (int i = 0; i < ?; i++) {
            //
            //}
            System.out.println((int)Math.floor(a + Math.pow(a,2) + Math.pow(a,3)));
            return null;
        }
    }
}