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