import java.util.*;
import static java.lang.Math.*;

class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int a = sc.nextInt();
        System.out.println(a + a*a + a*a*a);
    }
} import java.util.*; util.* java import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int a = sc.nextInt();
        System.out.println(a + a*a + a*a*a);
    }
} Main final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args private void run() {
        int a = sc.nextInt();
        System.out.println(a + a*a + a*a*a);
    } run {
        int a = sc.nextInt();
        System.out.println(a + a*a + a*a*a);
    } int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc System.out.println(a + a*a + a*a*a) System.out.println System.out System System.out 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
import java.util.*;
import static java.lang.Math.*;

class Main {
    final Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        int a = sc.nextInt();
        System.out.println(a + a*a + a*a*a);
    }
}
