
import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.valueOf(br.readLine());
		int ans=(int)(n+Math.pow(n, 2)+Math.pow(n, 3));
		System.out.println(ans);
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.valueOf(br.readLine());
		int ans=(int)(n+Math.pow(n, 2)+Math.pow(n, 3));
		System.out.println(ans);
	}
} Main public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.valueOf(br.readLine());
		int ans=(int)(n+Math.pow(n, 2)+Math.pow(n, 3));
		System.out.println(ans);
	} main {
		// TODO Auto-generated method stub
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.valueOf(br.readLine());
		int ans=(int)(n+Math.pow(n, 2)+Math.pow(n, 3));
		System.out.println(ans);
	} BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n=Integer.valueOf(br.readLine()); n Integer.valueOf(br.readLine()) Integer.valueOf Integer br.readLine() br.readLine br int ans=(int)(n+Math.pow(n, 2)+Math.pow(n, 3)); ans (int)(n+Math.pow(n, 2)+Math.pow(n, 3)) n+Math.pow(n, 2)+Math.pow(n, 3) n Math.pow(n, 2) Math.pow Math n 2 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 public class Main {
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.valueOf(br.readLine());
		int ans=(int)(n+Math.pow(n, 2)+Math.pow(n, 3));
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.valueOf(br.readLine());
		int ans=(int)(n+Math.pow(n, 2)+Math.pow(n, 3));
		System.out.println(ans);
	}
} Main

import java.util.*;
import java.io.*;

public class Main {
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=Integer.valueOf(br.readLine());
		int ans=(int)(n+Math.pow(n, 2)+Math.pow(n, 3));
		System.out.println(ans);
	}
}
