import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
public class Main {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();

        System.out.println(a + a*a + a*a*a);

    }
} import java.util.*; util.* java import java.util.regex.Matcher; Matcher java.util.regex import java.util.regex.Pattern; Pattern java.util.regex public class Main {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();

        System.out.println(a + a*a + a*a*a);

    }
} Main public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();

        System.out.println(a + a*a + a*a*a);

    } main {

        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 String[] args args public class Main {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();

        System.out.println(a + a*a + a*a*a);

    }
} public class Main {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();

        System.out.println(a + a*a + a*a*a);

    }
} Main
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
 
public class Main {
    public static void main(String[] args) {

        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();

        System.out.println(a + a*a + a*a*a);

    }
}