import java.util.*;

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

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