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

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

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