import java.util.Scanner;
import java.awt.image.BandedSampleModel;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {


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

    }
} import java.util.Scanner; Scanner java.util import java.awt.image.BandedSampleModel; BandedSampleModel java.awt.image import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.lang.reflect.Array; Array java.lang.reflect import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {


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

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

    } main {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int ans=a+a*a+a*a*a;
        System.out.println(ans);

    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int a=sc.nextInt(); a sc.nextInt() sc.nextInt sc int ans=a+a*a+a*a*a; ans 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(ans) System.out.println System.out System System.out ans String args[] args public class Main {


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

    }
} public class Main {


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

    }
} Main
import java.util.Scanner;
import java.awt.image.BandedSampleModel;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {


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

    }
}
