//package ABC172;
import java.util.*;
import java.lang.*;
import java.io.*;

class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		
		long ans=n+(long)Math.pow(n, 2)+(long)Math.pow(n, 3);
		
		System.out.println(ans);
	}

} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		
		long ans=n+(long)Math.pow(n, 2)+(long)Math.pow(n, 3);
		
		System.out.println(ans);
	}

} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		
		long ans=n+(long)Math.pow(n, 2)+(long)Math.pow(n, 3);
		
		System.out.println(ans);
	} main {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		
		long ans=n+(long)Math.pow(n, 2)+(long)Math.pow(n, 3);
		
		System.out.println(ans);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) long n=sc.nextLong(); n sc.nextLong() sc.nextLong sc long ans=n+(long)Math.pow(n, 2)+(long)Math.pow(n, 3); ans n+(long)Math.pow(n, 2)+(long)Math.pow(n, 3) n+(long)Math.pow(n, 2)+(long)Math.pow(n, 3) n (long)Math.pow(n, 2) Math.pow Math n 2 (long)Math.pow(n, 3) Math.pow Math n 3 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
//package ABC172;
import java.util.*;
import java.lang.*;
import java.io.*;

class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		long n=sc.nextLong();
		
		long ans=n+(long)Math.pow(n, 2)+(long)Math.pow(n, 3);
		
		System.out.println(ans);
	}

}
