import java.io.IOException;
import java.util.Scanner;

public class Main {

public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		System.out.println(n+(n*n)+(n*n*n));
}
} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {

public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		System.out.println(n+(n*n)+(n*n*n));
}
} Main public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		System.out.println(n+(n*n)+(n*n*n));
} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		System.out.println(n+(n*n)+(n*n*n));
} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan 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) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		System.out.println(n+(n*n)+(n*n*n));
}
} public class Main {

public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		System.out.println(n+(n*n)+(n*n*n));
}
} Main
import java.io.IOException;
import java.util.Scanner;

public class Main {

public static void main(String[] args) throws IOException {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		System.out.println(n+(n*n)+(n*n*n));
}
}
