import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();

    System.out.println(a + a*a + a*a*a);
    
    

    


    
    


    


    
    


    
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.*; io.* java import java.util.*; util.* java import java.util.ArrayList; ArrayList java.util import java.util.Iterator; Iterator java.util import java.util.List; List java.util import java.util.Collections; Collections java.util import java.util.Arrays; Arrays java.util public class Main {
	public static void main(final String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();

    System.out.println(a + a*a + a*a*a);
    
    

    


    
    


    


    
    


    
	}
} Main public static void main(final String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();

    System.out.println(a + a*a + a*a*a);
    
    

    


    
    


    


    
    


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

    System.out.println(a + a*a + a*a*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(a + a*a + a*a*a) System.out.println System.out System System.out 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 final String[] args args public class Main {
	public static void main(final String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();

    System.out.println(a + a*a + a*a*a);
    
    

    


    
    


    


    
    


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

    System.out.println(a + a*a + a*a*a);
    
    

    


    
    


    


    
    


    
	}
} Main
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    Scanner sc = new Scanner(System.in);
    
    int a = sc.nextInt();

    System.out.println(a + a*a + a*a*a);
    
    

    


    
    


    


    
    


    
	}
}