import java.util.*;
public class Main {
    public void solve() {
        Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    System.out.println(a+a*a+a*a*a);

    }

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

    }

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

    } solve {
        Scanner scan = new Scanner(System.in);
    int a = scan.nextInt();
    System.out.println(a+a*a+a*a*a);

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

    }

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

    }

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

    }

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