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

public class Main
{
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double total = Math.pow(a, 2) + Math.pow(a, 3) + a;
        System.out.println((int)(total));
    }
} import java.io.*; io.* java import java.lang.*; lang.* java import java.util.*; util.* java public class Main
{
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double total = Math.pow(a, 2) + Math.pow(a, 3) + a;
        System.out.println((int)(total));
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double total = Math.pow(a, 2) + Math.pow(a, 3) + a;
        System.out.println((int)(total));
    } main {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double total = Math.pow(a, 2) + Math.pow(a, 3) + a;
        System.out.println((int)(total));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) double a = sc.nextDouble(); a sc.nextDouble() sc.nextDouble sc double total = Math.pow(a, 2) + Math.pow(a, 3) + a; total Math.pow(a, 2) + Math.pow(a, 3) + a Math.pow(a, 2) + Math.pow(a, 3) + a Math.pow(a, 2) Math.pow Math a 2 Math.pow(a, 3) Math.pow Math a 3 a System.out.println((int)(total)) System.out.println System.out System System.out (int)(total) String[] args args public class Main
{
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double total = Math.pow(a, 2) + Math.pow(a, 3) + a;
        System.out.println((int)(total));
    }
} public class Main
{
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double total = Math.pow(a, 2) + Math.pow(a, 3) + a;
        System.out.println((int)(total));
    }
} Main
import java.io.*;
import java.lang.*;
import java.util.*;

public class Main
{
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double total = Math.pow(a, 2) + Math.pow(a, 3) + a;
        System.out.println((int)(total));
    }
}
