import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		long val =n;
		long sum=0;
	     for(int i=0;i<3;i++){
	    	 sum+=val;
	    	 val*=n;
	     }
		System.out.println(sum);

	}

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		long val =n;
		long sum=0;
	     for(int i=0;i<3;i++){
	    	 sum+=val;
	    	 val*=n;
	     }
		System.out.println(sum);

	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		long val =n;
		long sum=0;
	     for(int i=0;i<3;i++){
	    	 sum+=val;
	    	 val*=n;
	     }
		System.out.println(sum);

	} main {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		long val =n;
		long sum=0;
	     for(int i=0;i<3;i++){
	    	 sum+=val;
	    	 val*=n;
	     }
		System.out.println(sum);

	} Scanner scn=new Scanner(System.in); scn new Scanner(System.in) int n=scn.nextInt(); n scn.nextInt() scn.nextInt scn long val =n; val n long sum=0; sum 0 for(int i=0;i<3;i++){
	    	 sum+=val;
	    	 val*=n;
	     } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
	    	 sum+=val;
	    	 val*=n;
	     } {
	    	 sum+=val;
	    	 val*=n;
	     } sum+=val sum val val*=n val n System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		long val =n;
		long sum=0;
	     for(int i=0;i<3;i++){
	    	 sum+=val;
	    	 val*=n;
	     }
		System.out.println(sum);

	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		long val =n;
		long sum=0;
	     for(int i=0;i<3;i++){
	    	 sum+=val;
	    	 val*=n;
	     }
		System.out.println(sum);

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int n=scn.nextInt();
		long val =n;
		long sum=0;
	     for(int i=0;i<3;i++){
	    	 sum+=val;
	    	 val*=n;
	     }
		System.out.println(sum);

	}

}