import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
    public static void main(String args[])throws IOException
    {
        Scanner obj=new Scanner(System.in);
        int a=obj.nextInt();
        int s=a+(a*a)+(a*a*a);
        System.out.println(s);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
    public static void main(String args[])throws IOException
    {
        Scanner obj=new Scanner(System.in);
        int a=obj.nextInt();
        int s=a+(a*a)+(a*a*a);
        System.out.println(s);
    }
} Main public static void main(String args[])throws IOException
    {
        Scanner obj=new Scanner(System.in);
        int a=obj.nextInt();
        int s=a+(a*a)+(a*a*a);
        System.out.println(s);
    } main {
        Scanner obj=new Scanner(System.in);
        int a=obj.nextInt();
        int s=a+(a*a)+(a*a*a);
        System.out.println(s);
    } Scanner obj=new Scanner(System.in); obj new Scanner(System.in) int a=obj.nextInt(); a obj.nextInt() obj.nextInt obj int s=a+(a*a)+(a*a*a); s a+(a*a)+(a*a*a) a+(a*a)+(a*a*a) a (a*a) a a (a*a*a) a*a*a a a a System.out.println(s) System.out.println System.out System System.out s String args[] args
import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
    public static void main(String args[])throws IOException
    {
        Scanner obj=new Scanner(System.in);
        int a=obj.nextInt();
        int s=a+(a*a)+(a*a*a);
        System.out.println(s);
    }
}