import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        System.out.println(calc(a));
    }

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

    public static int calc(int a){
        return a + a*a + a*a*a;
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        System.out.println(calc(a));
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        System.out.println(calc(a));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc System.out.println(calc(a)) System.out.println System.out System System.out calc(a) calc a String[] args args public static int calc(int a){
        return a + a*a + a*a*a;
    } calc {
        return a + a*a + a*a*a;
    } return a + a*a + a*a*a; a + a*a + a*a*a a + a*a + a*a*a a a*a a a a*a*a a*a*a a a a int a a public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        System.out.println(calc(a));
    }

    public static int calc(int a){
        return a + a*a + a*a*a;
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        System.out.println(calc(a));
    }

    public static int calc(int a){
        return a + a*a + a*a*a;
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        System.out.println(calc(a));
    }

    public static int calc(int a){
        return a + a*a + a*a*a;
    }
}
