import java.util.Scanner;

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

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

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

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

} Main
import java.util.Scanner;

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

}
