import java.util.Scanner;

/**
 *
 * @author HP
 */
public class Main {
   public static void main(String[] args) {
       Scanner s= new Scanner(System.in);
       int a = s.nextInt();
       long res = a;
       res += a*a +a*a*a;
       System.out.println(res);
   }
} import java.util.Scanner; Scanner java.util public class Main {
   public static void main(String[] args) {
       Scanner s= new Scanner(System.in);
       int a = s.nextInt();
       long res = a;
       res += a*a +a*a*a;
       System.out.println(res);
   }
} Main public static void main(String[] args) {
       Scanner s= new Scanner(System.in);
       int a = s.nextInt();
       long res = a;
       res += a*a +a*a*a;
       System.out.println(res);
   } main {
       Scanner s= new Scanner(System.in);
       int a = s.nextInt();
       long res = a;
       res += a*a +a*a*a;
       System.out.println(res);
   } Scanner s= new Scanner(System.in); s new Scanner(System.in) int a = s.nextInt(); a s.nextInt() s.nextInt s long res = a; res a res += a*a +a*a*a res a*a +a*a*a a*a a a a*a*a a*a*a a a a System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {
   public static void main(String[] args) {
       Scanner s= new Scanner(System.in);
       int a = s.nextInt();
       long res = a;
       res += a*a +a*a*a;
       System.out.println(res);
   }
} public class Main {
   public static void main(String[] args) {
       Scanner s= new Scanner(System.in);
       int a = s.nextInt();
       long res = a;
       res += a*a +a*a*a;
       System.out.println(res);
   }
} Main
import java.util.Scanner;

/**
 *
 * @author HP
 */
public class Main {
   public static void main(String[] args) {
       Scanner s= new Scanner(System.in);
       int a = s.nextInt();
       long res = a;
       res += a*a +a*a*a;
       System.out.println(res);
   }
}