import java.util.*;
public class Main {

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

} import java.util.*; util.* java public class Main {

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

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

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

} public class Main {

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

} Main
import java.util.*;
public class Main {

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

}