import java.util.Scanner;

public class Main
{
    public static void main(String[] args)
    {
        int a,ans;
        Scanner scanner = new Scanner(System.in);
        
        a = scanner.nextInt();
        ans = a + a*a + a*a*a;
        
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main
{
    public static void main(String[] args)
    {
        int a,ans;
        Scanner scanner = new Scanner(System.in);
        
        a = scanner.nextInt();
        ans = a + a*a + a*a*a;
        
        System.out.println(ans);
    }
} Main public static void main(String[] args)
    {
        int a,ans;
        Scanner scanner = new Scanner(System.in);
        
        a = scanner.nextInt();
        ans = a + a*a + a*a*a;
        
        System.out.println(ans);
    } main {
        int a,ans;
        Scanner scanner = new Scanner(System.in);
        
        a = scanner.nextInt();
        ans = a + a*a + a*a*a;
        
        System.out.println(ans);
    } int a a ans; ans Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) a = scanner.nextInt() a scanner.nextInt() scanner.nextInt scanner 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)
    {
        int a,ans;
        Scanner scanner = new Scanner(System.in);
        
        a = scanner.nextInt();
        ans = a + a*a + a*a*a;
        
        System.out.println(ans);
    }
} public class Main
{
    public static void main(String[] args)
    {
        int a,ans;
        Scanner scanner = new Scanner(System.in);
        
        a = scanner.nextInt();
        ans = a + a*a + a*a*a;
        
        System.out.println(ans);
    }
} Main
import java.util.Scanner;

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