import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();

        System.out.println(solve(a));

        sc.close();
    }

    static int solve(int a) {
        return a + a * a + a * a * a;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();

        System.out.println(solve(a));

        sc.close();
    }

    static int solve(int a) {
        return a + a * a + a * a * a;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();

        System.out.println(solve(a));

        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();

        System.out.println(solve(a));

        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc System.out.println(solve(a)) System.out.println System.out System System.out solve(a) solve a sc.close() sc.close sc String[] args args static int solve(int a) {
        return a + a * a + a * a * a;
    } solve {
        return a + a * a + a * a * a;
    } return 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 a * a * a a a a int a a public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();

        System.out.println(solve(a));

        sc.close();
    }

    static int solve(int a) {
        return a + a * a + a * a * a;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();

        System.out.println(solve(a));

        sc.close();
    }

    static int solve(int a) {
        return a + a * a + a * a * a;
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();

        System.out.println(solve(a));

        sc.close();
    }

    static int solve(int a) {
        return a + a * a + a * a * a;
    }
}