import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        a = (int)(a + Math.pow(a, 2) + Math.pow(a, 3));
        System.out.println(a);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        a = (int)(a + Math.pow(a, 2) + Math.pow(a, 3));
        System.out.println(a);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        a = (int)(a + Math.pow(a, 2) + Math.pow(a, 3));
        System.out.println(a);
    } main {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        a = (int)(a + Math.pow(a, 2) + Math.pow(a, 3));
        System.out.println(a);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan a = (int)(a + Math.pow(a, 2) + Math.pow(a, 3)) a (int)(a + 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 System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        a = (int)(a + Math.pow(a, 2) + Math.pow(a, 3));
        System.out.println(a);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        a = (int)(a + Math.pow(a, 2) + Math.pow(a, 3));
        System.out.println(a);
    }
} Main
import java.util.*;

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