from typing import Iterable
from typing import Callable


def count_nice_words(all_words: Iterable[str], checker: Callable[[str], bool]) -> int:
    """
    Count the number of words which are nice, using the given nice-word-checking function.
    """
    return sum(1 for word in all_words if checker(word))