import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in)) {
            System.out.println(new Main().run(sc));
        }
    }

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

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

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

    public String run(Scanner sc) {
        int a = Integer.parseInt(sc.nextLine());
        return String.valueOf(a + a*a + a*a*a);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in)) {
            System.out.println(new Main().run(sc));
        }
    }

    public String run(Scanner sc) {
        int a = Integer.parseInt(sc.nextLine());
        return String.valueOf(a + a*a + a*a*a);
    }
}
