from typing import Callable


def run_for_n_iterations(n: int) -> Callable:
    """
    Creates a function that allows to run exactly n conversations if provided
    as a value of `should_continue` param to ConversationHandler constructor.
    :param n: number of conversations
    :return: pointer to a function that allows to run exactly n conversations
    """
    return lambda handler: handler.iterations <= n