import java.util.Scanner;
public class Main {
	int as,kl,o,m,n;
	char p;
	Scanner sc = new Scanner(System.in);
	public void solve() {	
	n=sc.nextInt();
	as=n*n;
	kl=n*n*n;
	System.out.println(n+as+kl);
	}
	public static void main(String[] args) {
		new Main().solve();
	
	}
} import java.util.Scanner; Scanner java.util public class Main {
	int as,kl,o,m,n;
	char p;
	Scanner sc = new Scanner(System.in);
	public void solve() {	
	n=sc.nextInt();
	as=n*n;
	kl=n*n*n;
	System.out.println(n+as+kl);
	}
	public static void main(String[] args) {
		new Main().solve();
	
	}
} Main int as as kl kl o o m m n; n char p; p Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public void solve() {	
	n=sc.nextInt();
	as=n*n;
	kl=n*n*n;
	System.out.println(n+as+kl);
	} solve {	
	n=sc.nextInt();
	as=n*n;
	kl=n*n*n;
	System.out.println(n+as+kl);
	} n=sc.nextInt() n sc.nextInt() sc.nextInt sc as=n*n as n*n n n kl=n*n*n kl n*n*n n*n*n n n n System.out.println(n+as+kl) System.out.println System.out System System.out n+as+kl n+as+kl n as kl public static void main(String[] args) {
		new Main().solve();
	
	} main {
		new Main().solve();
	
	} new Main().solve() new Main().solve new Main() String[] args args public class Main {
	int as,kl,o,m,n;
	char p;
	Scanner sc = new Scanner(System.in);
	public void solve() {	
	n=sc.nextInt();
	as=n*n;
	kl=n*n*n;
	System.out.println(n+as+kl);
	}
	public static void main(String[] args) {
		new Main().solve();
	
	}
} public class Main {
	int as,kl,o,m,n;
	char p;
	Scanner sc = new Scanner(System.in);
	public void solve() {	
	n=sc.nextInt();
	as=n*n;
	kl=n*n*n;
	System.out.println(n+as+kl);
	}
	public static void main(String[] args) {
		new Main().solve();
	
	}
} Main
import java.util.Scanner;
public class Main {
	int as,kl,o,m,n;
	char p;
	Scanner sc = new Scanner(System.in);
	public void solve() {	
	n=sc.nextInt();
	as=n*n;
	kl=n*n*n;
	System.out.println(n+as+kl);
	}
	public static void main(String[] args) {
		new Main().solve();
	
	}
}
