import java.util.*;
import java.math.*;
public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int A = K + (K*K) + (K*K*K) ;
		
		System.out.println(A);
   
        }
	}
  import java.util.*; util.* java import java.math.*; math.* java public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int A = K + (K*K) + (K*K*K) ;
		
		System.out.println(A);
   
        }
	} Main public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int A = K + (K*K) + (K*K*K) ;
		
		System.out.println(A);
   
        } main {
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int A = K + (K*K) + (K*K*K) ;
		
		System.out.println(A);
   
        } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int K = sc.nextInt(); K sc.nextInt() sc.nextInt sc int A = K + (K*K) + (K*K*K) ; A K + (K*K) + (K*K*K) K + (K*K) + (K*K*K) K (K*K) K K (K*K*K) K*K*K K K K System.out.println(A) System.out.println System.out System System.out A String[] args args public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int A = K + (K*K) + (K*K*K) ;
		
		System.out.println(A);
   
        }
	} public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int A = K + (K*K) + (K*K*K) ;
		
		System.out.println(A);
   
        }
	} Main
import java.util.*;
import java.math.*;
public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int A = K + (K*K) + (K*K*K) ;
		
		System.out.println(A);
   
        }
	}
 
