import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = Integer.parseInt(scanner.next());
        int answer = 0;

        scanner.close();
        answer = a + a * a + a * a * a;
        
        System.out.println(answer);
    }
} 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.parseInt(scanner.next());
        int answer = 0;

        scanner.close();
        answer = a + a * a + a * a * a;
        
        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = Integer.parseInt(scanner.next());
        int answer = 0;

        scanner.close();
        answer = a + a * a + a * a * a;
        
        System.out.println(answer);
    } main {
        Scanner scanner = new Scanner(System.in);
        int a = Integer.parseInt(scanner.next());
        int answer = 0;

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

        scanner.close();
        answer = a + a * a + a * a * a;
        
        System.out.println(answer);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = Integer.parseInt(scanner.next());
        int answer = 0;

        scanner.close();
        answer = a + a * a + a * a * a;
        
        System.out.println(answer);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = Integer.parseInt(scanner.next());
        int answer = 0;

        scanner.close();
        answer = a + a * a + a * a * a;
        
        System.out.println(answer);
    }
}
