import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
		int sum = a + kaijou2(a) + kaijou3(a);
      	System.out.println(sum);
    }
  
  	public static int kaijou2 (int a) {
      	return a*a;
    }
  
  	public static int kaijou3 (int a) {
      	return a*a*a;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
		int sum = a + kaijou2(a) + kaijou3(a);
      	System.out.println(sum);
    }
  
  	public static int kaijou2 (int a) {
      	return a*a;
    }
  
  	public static int kaijou3 (int a) {
      	return a*a*a;
    }
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
		int sum = a + kaijou2(a) + kaijou3(a);
      	System.out.println(sum);
    } main {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
		int sum = a + kaijou2(a) + kaijou3(a);
      	System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int sum = a + kaijou2(a) + kaijou3(a); sum a + kaijou2(a) + kaijou3(a) a + kaijou2(a) + kaijou3(a) a kaijou2(a) kaijou2 a kaijou3(a) kaijou3 a System.out.println(sum) System.out.println System.out System System.out sum String[] args args public static int kaijou2 (int a) {
      	return a*a;
    } kaijou2 {
      	return a*a;
    } return a*a; a*a a a int a a public static int kaijou3 (int a) {
      	return a*a*a;
    } kaijou3 {
      	return a*a*a;
    } return a*a*a; a*a*a a*a*a a a a int a a public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
		int sum = a + kaijou2(a) + kaijou3(a);
      	System.out.println(sum);
    }
  
  	public static int kaijou2 (int a) {
      	return a*a;
    }
  
  	public static int kaijou3 (int a) {
      	return a*a*a;
    }
} public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
		int sum = a + kaijou2(a) + kaijou3(a);
      	System.out.println(sum);
    }
  
  	public static int kaijou2 (int a) {
      	return a*a;
    }
  
  	public static int kaijou3 (int a) {
      	return a*a*a;
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
		int sum = a + kaijou2(a) + kaijou3(a);
      	System.out.println(sum);
    }
  
  	public static int kaijou2 (int a) {
      	return a*a;
    }
  
  	public static int kaijou3 (int a) {
      	return a*a*a;
    }
}