def required_passes(bytes_per_pass, share_sizes):
    """
    Calculate the number of passes that are required to store shares of the
    given sizes for one lease period.

    :param int bytes_per_pass: The number of bytes the storage of which for
        one lease period one pass covers.

    :param list[int] share_sizes: The sizes of the shared which will be stored.

    :return int: The number of passes required to cover the storage cost.
    """
    if not isinstance(share_sizes, list):
        raise TypeError(
            "Share sizes must be a list of integers, got {!r} instead".format(
                share_sizes,
            ),
        )
    result, b = divmod(sum(share_sizes, 0), bytes_per_pass)
    if b:
        result += 1

    # print("required_passes({}, {}) == {}".format(bytes_per_pass, share_sizes, result))
    return result