
import java.util.*;


class Main {
	public static void main (String[] args) {
	    Scanner s=new Scanner(System.in);
	    int a=s.nextInt();
        int sum=a+a*a+a*a*a;
        System.out.println(sum);
	}} import java.util.*; util.* java class Main {
	public static void main (String[] args) {
	    Scanner s=new Scanner(System.in);
	    int a=s.nextInt();
        int sum=a+a*a+a*a*a;
        System.out.println(sum);
	}} Main public static void main (String[] args) {
	    Scanner s=new Scanner(System.in);
	    int a=s.nextInt();
        int sum=a+a*a+a*a*a;
        System.out.println(sum);
	} main {
	    Scanner s=new Scanner(System.in);
	    int a=s.nextInt();
        int sum=a+a*a+a*a*a;
        System.out.println(sum);
	} Scanner s=new Scanner(System.in); s new Scanner(System.in) int a=s.nextInt(); a s.nextInt() s.nextInt s int sum=a+a*a+a*a*a; sum a+a*a+a*a*a a+a*a+a*a*a a a*a a a a*a*a a*a*a a a a System.out.println(sum) System.out.println System.out System System.out sum String[] args args

import java.util.*;


class Main {
	public static void main (String[] args) {
	    Scanner s=new Scanner(System.in);
	    int a=s.nextInt();
        int sum=a+a*a+a*a*a;
        System.out.println(sum);
	}}
