import java.util.*;
import java.util.function.*;
import java.math.*;
public class Main {
    public static void main(String[] args){
			Scanner s = new Scanner(System.in);
		int N = Integer.valueOf(s.next());
		
		System.out.println((N + N * N + N * N * N));
	}
} import java.util.*; util.* java import java.util.function.*; function.* java.util import java.math.*; math.* java public class Main {
    public static void main(String[] args){
			Scanner s = new Scanner(System.in);
		int N = Integer.valueOf(s.next());
		
		System.out.println((N + N * N + N * N * N));
	}
} Main public static void main(String[] args){
			Scanner s = new Scanner(System.in);
		int N = Integer.valueOf(s.next());
		
		System.out.println((N + N * N + N * N * N));
	} main {
			Scanner s = new Scanner(System.in);
		int N = Integer.valueOf(s.next());
		
		System.out.println((N + N * N + N * N * N));
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int N = Integer.valueOf(s.next()); N Integer.valueOf(s.next()) Integer.valueOf Integer s.next() s.next s System.out.println((N + N * N + N * N * N)) System.out.println System.out System System.out (N + N * N + N * N * N) N + N * N + N * N * N N N * N N N N * N * N N * N * N N N N String[] args args public class Main {
    public static void main(String[] args){
			Scanner s = new Scanner(System.in);
		int N = Integer.valueOf(s.next());
		
		System.out.println((N + N * N + N * N * N));
	}
} public class Main {
    public static void main(String[] args){
			Scanner s = new Scanner(System.in);
		int N = Integer.valueOf(s.next());
		
		System.out.println((N + N * N + N * N * N));
	}
} Main
import java.util.*;
import java.util.function.*;
import java.math.*;
public class Main {
    public static void main(String[] args){
			Scanner s = new Scanner(System.in);
		int N = Integer.valueOf(s.next());
		
		System.out.println((N + N * N + N * N * N));
	}
}