import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int ans = 0;
		int in = s.nextInt();
		ans = in+(int)Math.pow(in,2)+(int)Math.pow(in,3);
		System.out.print(ans);	
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int ans = 0;
		int in = s.nextInt();
		ans = in+(int)Math.pow(in,2)+(int)Math.pow(in,3);
		System.out.print(ans);	
	}
} Main public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int ans = 0;
		int in = s.nextInt();
		ans = in+(int)Math.pow(in,2)+(int)Math.pow(in,3);
		System.out.print(ans);	
	} main {
		Scanner s = new Scanner(System.in);
		int ans = 0;
		int in = s.nextInt();
		ans = in+(int)Math.pow(in,2)+(int)Math.pow(in,3);
		System.out.print(ans);	
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int ans = 0; ans 0 int in = s.nextInt(); in s.nextInt() s.nextInt s ans = in+(int)Math.pow(in,2)+(int)Math.pow(in,3) ans in+(int)Math.pow(in,2)+(int)Math.pow(in,3) in+(int)Math.pow(in,2)+(int)Math.pow(in,3) in (int)Math.pow(in,2) Math.pow Math in 2 (int)Math.pow(in,3) Math.pow Math in 3 System.out.print(ans) System.out.print System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int ans = 0;
		int in = s.nextInt();
		ans = in+(int)Math.pow(in,2)+(int)Math.pow(in,3);
		System.out.print(ans);	
	}
} public class Main{
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int ans = 0;
		int in = s.nextInt();
		ans = in+(int)Math.pow(in,2)+(int)Math.pow(in,3);
		System.out.print(ans);	
	}
} Main
import java.util.*;
public class Main{
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int ans = 0;
		int in = s.nextInt();
		ans = in+(int)Math.pow(in,2)+(int)Math.pow(in,3);
		System.out.print(ans);	
	}
}