	import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
	
	public class Main {
	
		public static void main(String[] args) {
			execute16_4();
		}
		
		private static void execute16_4() {
			try 
			(Scanner sc = new Scanner(System.in)) {
				int s = sc.nextInt();
				System.out.println(s+s*s+s*s*s);
			}
		}
    } import java.util.ArrayDeque; ArrayDeque java.util import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.Deque; Deque java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Queue; Queue java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {
	
		public static void main(String[] args) {
			execute16_4();
		}
		
		private static void execute16_4() {
			try 
			(Scanner sc = new Scanner(System.in)) {
				int s = sc.nextInt();
				System.out.println(s+s*s+s*s*s);
			}
		}
    } Main public static void main(String[] args) {
			execute16_4();
		} main {
			execute16_4();
		} execute16_4() execute16_4 String[] args args private static void execute16_4() {
			try 
			(Scanner sc = new Scanner(System.in)) {
				int s = sc.nextInt();
				System.out.println(s+s*s+s*s*s);
			}
		} execute16_4 {
			try 
			(Scanner sc = new Scanner(System.in)) {
				int s = sc.nextInt();
				System.out.println(s+s*s+s*s*s);
			}
		} try 
			(Scanner sc = new Scanner(System.in)) {
				int s = sc.nextInt();
				System.out.println(s+s*s+s*s*s);
			} {
				int s = sc.nextInt();
				System.out.println(s+s*s+s*s*s);
			} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc System.out.println(s+s*s+s*s*s) System.out.println System.out System System.out s+s*s+s*s*s s+s*s+s*s*s s s*s s s s*s*s s*s*s s s s public class Main {
	
		public static void main(String[] args) {
			execute16_4();
		}
		
		private static void execute16_4() {
			try 
			(Scanner sc = new Scanner(System.in)) {
				int s = sc.nextInt();
				System.out.println(s+s*s+s*s*s);
			}
		}
    } public class Main {
	
		public static void main(String[] args) {
			execute16_4();
		}
		
		private static void execute16_4() {
			try 
			(Scanner sc = new Scanner(System.in)) {
				int s = sc.nextInt();
				System.out.println(s+s*s+s*s*s);
			}
		}
    } Main
	import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
import java.util.Set;
	
	public class Main {
	
		public static void main(String[] args) {
			execute16_4();
		}
		
		private static void execute16_4() {
			try 
			(Scanner sc = new Scanner(System.in)) {
				int s = sc.nextInt();
				System.out.println(s+s*s+s*s*s);
			}
		}
    }