import java.lang.reflect.Array;
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int r = sc.nextInt();

        System.out.println ((r*r*r)+(r*r)+(r));
    }
} import java.lang.reflect.Array; Array java.lang.reflect import java.util.*; util.* java import java.io.*; io.* java import java.lang.*; lang.* java public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int r = sc.nextInt();

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

        int r = sc.nextInt();

        System.out.println ((r*r*r)+(r*r)+(r));
    } main {
        Scanner sc = new Scanner(System.in);

        int r = sc.nextInt();

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

        int r = sc.nextInt();

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

        int r = sc.nextInt();

        System.out.println ((r*r*r)+(r*r)+(r));
    }
} Main
import java.lang.reflect.Array;
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int r = sc.nextInt();

        System.out.println ((r*r*r)+(r*r)+(r));
    }
}
