import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int square = a*a;
		int cube = a*a*a;
		int res = a + square + cube;
		System.out.println(res);
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int square = a*a;
		int cube = a*a*a;
		int res = a + square + cube;
		System.out.println(res);
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int square = a*a;
		int cube = a*a*a;
		int res = a + square + cube;
		System.out.println(res);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int square = a*a;
		int cube = a*a*a;
		int res = a + square + cube;
		System.out.println(res);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int square = a*a; square a*a a a int cube = a*a*a; cube a*a*a a*a*a a a a int res = a + square + cube; res a + square + cube a + square + cube a square cube System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int square = a*a;
		int cube = a*a*a;
		int res = a + square + cube;
		System.out.println(res);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int square = a*a;
		int cube = a*a*a;
		int res = a + square + cube;
		System.out.println(res);
	}

} Main
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int square = a*a;
		int cube = a*a*a;
		int res = a + square + cube;
		System.out.println(res);
	}

}
