import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Math.max;



public class Main {

   

    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        System.out.println(n+n*n+n*n*n);

    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.lang.reflect.Array; Array java.lang.reflect import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java import static java.lang.Math.max; import static java.lang.Math.max; import static java.lang.Math.max; public class Main {

   

    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        System.out.println(n+n*n+n*n*n);

    }
} Main public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        System.out.println(n+n*n+n*n*n);

    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        System.out.println(n+n*n+n*n*n);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc System.out.println(n+n*n+n*n*n) System.out.println System.out System System.out n+n*n+n*n*n n+n*n+n*n*n n n*n n n n*n*n n*n*n n n n String args[] args public class Main {

   

    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        System.out.println(n+n*n+n*n*n);

    }
} public class Main {

   

    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        System.out.println(n+n*n+n*n*n);

    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

import static java.lang.Math.max;



public class Main {

   

    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        System.out.println(n+n*n+n*n*n);

    }
}