
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
int a=n*n, b=a*n;
System.out.println(a+b+n);
}
} import java.util.Scanner; Scanner java.util public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
int a=n*n, b=a*n;
System.out.println(a+b+n);
}
} Main public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
int a=n*n, b=a*n;
System.out.println(a+b+n);
} main {
Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
int a=n*n, b=a*n;
System.out.println(a+b+n);
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int a=n*n a n*n n n b=a*n; b a*n a n System.out.println(a+b+n) System.out.println System.out System System.out a+b+n a+b+n a b n String[] args args public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
int a=n*n, b=a*n;
System.out.println(a+b+n);
}
} public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
int a=n*n, b=a*n;
System.out.println(a+b+n);
}
} Main

import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
int a=n*n, b=a*n;
System.out.println(a+b+n);
}
}