import java.util.Scanner;
import java.util.Random;
import java.math.*;

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

        int b=(int)(Math.pow(a,2)+Math.pow(a,3)+a);
            System.out.println(b);
    }
} import java.util.Scanner; Scanner java.util import java.util.Random; Random java.util import java.math.*; math.* java public class Main{
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        int a = sc.nextInt();

        int b=(int)(Math.pow(a,2)+Math.pow(a,3)+a);
            System.out.println(b);
    }
} Main public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        int a = sc.nextInt();

        int b=(int)(Math.pow(a,2)+Math.pow(a,3)+a);
            System.out.println(b);
    } main {
        Scanner sc =new Scanner(System.in);
        int a = sc.nextInt();

        int b=(int)(Math.pow(a,2)+Math.pow(a,3)+a);
            System.out.println(b);
    } Scanner sc =new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b=(int)(Math.pow(a,2)+Math.pow(a,3)+a); b (int)(Math.pow(a,2)+Math.pow(a,3)+a) Math.pow(a,2)+Math.pow(a,3)+a Math.pow(a,2) Math.pow Math a 2 Math.pow(a,3) Math.pow Math a 3 a System.out.println(b) System.out.println System.out System System.out b String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        int a = sc.nextInt();

        int b=(int)(Math.pow(a,2)+Math.pow(a,3)+a);
            System.out.println(b);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc =new Scanner(System.in);
        int a = sc.nextInt();

        int b=(int)(Math.pow(a,2)+Math.pow(a,3)+a);
            System.out.println(b);
    }
} Main
import java.util.Scanner;
import java.util.Random;
import java.math.*;

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

        int b=(int)(Math.pow(a,2)+Math.pow(a,3)+a);
            System.out.println(b);
    }
}