import java.util.Scanner;
        
public class Main {

    public static void main(String[] args) {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = Integer.valueOf(scanner.nextLine());
        
        int value;
        
        value = a + (a*a) + (a*a*a);
        
        System.out.println(value);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = Integer.valueOf(scanner.nextLine());
        
        int value;
        
        value = a + (a*a) + (a*a*a);
        
        System.out.println(value);
    }
} Main public static void main(String[] args) {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = Integer.valueOf(scanner.nextLine());
        
        int value;
        
        value = a + (a*a) + (a*a*a);
        
        System.out.println(value);
    } main {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = Integer.valueOf(scanner.nextLine());
        
        int value;
        
        value = a + (a*a) + (a*a*a);
        
        System.out.println(value);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = Integer.valueOf(scanner.nextLine()); a Integer.valueOf(scanner.nextLine()) Integer.valueOf Integer scanner.nextLine() scanner.nextLine scanner int value; value value = a + (a*a) + (a*a*a) value 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(value) System.out.println System.out System System.out value String[] args args public class Main {

    public static void main(String[] args) {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = Integer.valueOf(scanner.nextLine());
        
        int value;
        
        value = a + (a*a) + (a*a*a);
        
        System.out.println(value);
    }
} public class Main {

    public static void main(String[] args) {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = Integer.valueOf(scanner.nextLine());
        
        int value;
        
        value = a + (a*a) + (a*a*a);
        
        System.out.println(value);
    }
} Main
import java.util.Scanner;
        
public class Main {

    public static void main(String[] args) {
        
        Scanner scanner = new Scanner(System.in);
        
        int a = Integer.valueOf(scanner.nextLine());
        
        int value;
        
        value = a + (a*a) + (a*a*a);
        
        System.out.println(value);
    }
}