/* package codechef; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc=new Scanner(System.in);
	    int t=sc.nextInt();
	    System.out.println(t+t*t+t*t*t);
	   }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc=new Scanner(System.in);
	    int t=sc.nextInt();
	    System.out.println(t+t*t+t*t*t);
	   }
} Main public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc=new Scanner(System.in);
	    int t=sc.nextInt();
	    System.out.println(t+t*t+t*t*t);
	   } main {
	    Scanner sc=new Scanner(System.in);
	    int t=sc.nextInt();
	    System.out.println(t+t*t+t*t*t);
	   } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int t=sc.nextInt(); t sc.nextInt() sc.nextInt sc System.out.println(t+t*t+t*t*t) System.out.println System.out System System.out t+t*t+t*t*t t+t*t+t*t*t t t*t t t t*t*t t*t*t t t t String[] args args
/* package codechef; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner sc=new Scanner(System.in);
	    int t=sc.nextInt();
	    System.out.println(t+t*t+t*t*t);
	   }
}