import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        System.out.println(a + (a * a) + (a * a * a));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        System.out.println(a + (a * a) + (a * a * a));
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        System.out.println(a + (a * a) + (a * a * a));
    } main {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        System.out.println(a + (a * a) + (a * a * a));
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int a = in.nextInt(); a in.nextInt() in.nextInt in System.out.println(a + (a * a) + (a * a * a)) System.out.println System.out System System.out 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 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        System.out.println(a + (a * a) + (a * a * a));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        System.out.println(a + (a * a) + (a * a * a));
    }
} Main
import java.util.Scanner;

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