/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        System.out.println(n + (n * n) + (n * n * n));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        System.out.println(n + (n * n) + (n * n * n));
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        System.out.println(n + (n * n) + (n * n * n));
    } main {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        System.out.println(n + (n * n) + (n * n * n));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) long n = scanner.nextLong(); n scanner.nextLong() scanner.nextLong scanner System.out.println(n + (n * n) + (n * n * n)) System.out.println System.out System System.out n + (n * n) + (n * n * n) n + (n * n) + (n * n * n) n (n * n) n n (n * n * n) n * n * n n n n String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        System.out.println(n + (n * n) + (n * n * n));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        System.out.println(n + (n * n) + (n * n * n));
    }
} Main
/*
Written by Kabir Kanha Arora
@kabirkanha
 */

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        System.out.println(n + (n * n) + (n * n * n));
    }
}
