import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
            double a = Double.parseDouble(sc.next());
            System.out.println((long)(a + Math.pow(a, 2) + Math.pow(a, 3)));

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
} import java.util.*; util.* java import java.math.*; math.* java class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
            double a = Double.parseDouble(sc.next());
            System.out.println((long)(a + Math.pow(a, 2) + Math.pow(a, 3)));

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
} Main public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
            double a = Double.parseDouble(sc.next());
            System.out.println((long)(a + Math.pow(a, 2) + Math.pow(a, 3)));

        }catch(Exception e){
            e.printStackTrace();
        }        
    } main {
        
        try(Scanner sc = new Scanner(System.in)){
            double a = Double.parseDouble(sc.next());
            System.out.println((long)(a + Math.pow(a, 2) + Math.pow(a, 3)));

        }catch(Exception e){
            e.printStackTrace();
        }        
    } try(Scanner sc = new Scanner(System.in)){
            double a = Double.parseDouble(sc.next());
            System.out.println((long)(a + Math.pow(a, 2) + Math.pow(a, 3)));

        }catch(Exception e){
            e.printStackTrace();
        } catch(Exception e){
            e.printStackTrace();
        } Exception e {
            e.printStackTrace();
        } e.printStackTrace() e.printStackTrace e {
            double a = Double.parseDouble(sc.next());
            System.out.println((long)(a + Math.pow(a, 2) + Math.pow(a, 3)));

        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) double a = Double.parseDouble(sc.next()); a Double.parseDouble(sc.next()) Double.parseDouble Double sc.next() sc.next sc System.out.println((long)(a + Math.pow(a, 2) + Math.pow(a, 3))) System.out.println System.out System System.out (long)(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 String[] args args
import java.util.*;
import java.math.*;
     
class Main{
    public static void main(String[] args) {
        
        try(Scanner sc = new Scanner(System.in)){
            double a = Double.parseDouble(sc.next());
            System.out.println((long)(a + Math.pow(a, 2) + Math.pow(a, 3)));

        }catch(Exception e){
            e.printStackTrace();
        }        
    }
}