import java.util.*;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        int varA = Integer.parseInt(sc.next());
        int result = varA + varA * varA + varA * varA * varA;
        sc.close();
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        int varA = Integer.parseInt(sc.next());
        int result = varA + varA * varA + varA * varA * varA;
        sc.close();
        System.out.println(result);
    }
} Main public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        int varA = Integer.parseInt(sc.next());
        int result = varA + varA * varA + varA * varA * varA;
        sc.close();
        System.out.println(result);
    } main {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        int varA = Integer.parseInt(sc.next());
        int result = varA + varA * varA + varA * varA * varA;
        sc.close();
        System.out.println(result);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int varA = Integer.parseInt(sc.next()); varA Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int result = varA + varA * varA + varA * varA * varA; result varA + varA * varA + varA * varA * varA varA + varA * varA + varA * varA * varA varA varA * varA varA varA varA * varA * varA varA * varA * varA varA varA varA sc.close() sc.close sc System.out.println(result) System.out.println System.out System System.out result final String[] args args public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        int varA = Integer.parseInt(sc.next());
        int result = varA + varA * varA + varA * varA * varA;
        sc.close();
        System.out.println(result);
    }
} public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        int varA = Integer.parseInt(sc.next());
        int result = varA + varA * varA + varA * varA * varA;
        sc.close();
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc = new Scanner(System.in);
        // 整数の入力
        // final int a = sc.nextInt();
        // 文字列の入力
        // final String s1 = sc.next();
        int varA = Integer.parseInt(sc.next());
        int result = varA + varA * varA + varA * varA * varA;
        sc.close();
        System.out.println(result);
    }
}