
import java.util.*;

public class Main
{

    private final static int MOD = 1_000_000_007;

    public static int gcd(int a, int b) { 
        // Everything divides 0  
        if (a == 0) 
          return b; 
        if (b == 0) 
          return a; 
       
        // base case 
        if (a == b) 
            return a; 
       
        // a is greater 
        if (a > b) 
            return gcd(a-b, b); 
        return gcd(a, b-a); 
    }
    
    public static long mod(long a, long b) {
        return ((a % b) + b ) % b;
    }

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

    private final static int MOD = 1_000_000_007;

    public static int gcd(int a, int b) { 
        // Everything divides 0  
        if (a == 0) 
          return b; 
        if (b == 0) 
          return a; 
       
        // base case 
        if (a == b) 
            return a; 
       
        // a is greater 
        if (a > b) 
            return gcd(a-b, b); 
        return gcd(a, b-a); 
    }
    
    public static long mod(long a, long b) {
        return ((a % b) + b ) % b;
    }

    public static int mod (int a, int b) {
        return ((a % b) + b ) % b;
    }
    
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
	int a = in.nextInt();
	System.out.println((int)(Math.pow(a,2) + Math.pow(a,3) + a));
	in.close();
    }
} Main private final static int MOD = 1_000_000_007; MOD 1_000_000_007 public static int gcd(int a, int b) { 
        // Everything divides 0  
        if (a == 0) 
          return b; 
        if (b == 0) 
          return a; 
       
        // base case 
        if (a == b) 
            return a; 
       
        // a is greater 
        if (a > b) 
            return gcd(a-b, b); 
        return gcd(a, b-a); 
    } gcd { 
        // Everything divides 0  
        if (a == 0) 
          return b; 
        if (b == 0) 
          return a; 
       
        // base case 
        if (a == b) 
            return a; 
       
        // a is greater 
        if (a > b) 
            return gcd(a-b, b); 
        return gcd(a, b-a); 
    } if (a == 0) 
          return b; a == 0 a 0 return b; b if (b == 0) 
          return a; b == 0 b 0 return a; a if (a == b) 
            return a; a == b a b return a; a if (a > b) 
            return gcd(a-b, b); a > b a b return gcd(a-b, b); gcd(a-b, b) gcd a-b a b b return gcd(a, b-a); gcd(a, b-a) gcd a b-a b a int a a int b b public static long mod(long a, long b) {
        return ((a % b) + b ) % b;
    } mod {
        return ((a % b) + b ) % b;
    } return ((a % b) + b ) % b; ((a % b) + b ) % b ((a % b) + b ) (a % b) a b b b long a a long b b public static int mod (int a, int b) {
        return ((a % b) + b ) % b;
    } mod {
        return ((a % b) + b ) % b;
    } return ((a % b) + b ) % b; ((a % b) + b ) % b ((a % b) + b ) (a % b) a b b b int a a int b b public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
	int a = in.nextInt();
	System.out.println((int)(Math.pow(a,2) + Math.pow(a,3) + a));
	in.close();
    } main {
        Scanner in = new Scanner(System.in);
	int a = in.nextInt();
	System.out.println((int)(Math.pow(a,2) + Math.pow(a,3) + a));
	in.close();
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int a = in.nextInt(); a in.nextInt() in.nextInt in System.out.println((int)(Math.pow(a,2) + Math.pow(a,3) + a)) System.out.println System.out System System.out (int)(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 a in.close() in.close in String[] args args public class Main
{

    private final static int MOD = 1_000_000_007;

    public static int gcd(int a, int b) { 
        // Everything divides 0  
        if (a == 0) 
          return b; 
        if (b == 0) 
          return a; 
       
        // base case 
        if (a == b) 
            return a; 
       
        // a is greater 
        if (a > b) 
            return gcd(a-b, b); 
        return gcd(a, b-a); 
    }
    
    public static long mod(long a, long b) {
        return ((a % b) + b ) % b;
    }

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

    private final static int MOD = 1_000_000_007;

    public static int gcd(int a, int b) { 
        // Everything divides 0  
        if (a == 0) 
          return b; 
        if (b == 0) 
          return a; 
       
        // base case 
        if (a == b) 
            return a; 
       
        // a is greater 
        if (a > b) 
            return gcd(a-b, b); 
        return gcd(a, b-a); 
    }
    
    public static long mod(long a, long b) {
        return ((a % b) + b ) % b;
    }

    public static int mod (int a, int b) {
        return ((a % b) + b ) % b;
    }
    
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
	int a = in.nextInt();
	System.out.println((int)(Math.pow(a,2) + Math.pow(a,3) + a));
	in.close();
    }
} Main

import java.util.*;

public class Main
{

    private final static int MOD = 1_000_000_007;

    public static int gcd(int a, int b) { 
        // Everything divides 0  
        if (a == 0) 
          return b; 
        if (b == 0) 
          return a; 
       
        // base case 
        if (a == b) 
            return a; 
       
        // a is greater 
        if (a > b) 
            return gcd(a-b, b); 
        return gcd(a, b-a); 
    }
    
    public static long mod(long a, long b) {
        return ((a % b) + b ) % b;
    }

    public static int mod (int a, int b) {
        return ((a % b) + b ) % b;
    }
    
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
	int a = in.nextInt();
	System.out.println((int)(Math.pow(a,2) + Math.pow(a,3) + a));
	in.close();
    }
}
