import java.util.Scanner;

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

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