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