def find_rooms_at_least_far_as(distances, wanted_distance):
    """Find rooms with at least wanted_distance from the distances grid."""
    return sum(
        True
        for row in distances
        for col in row
        if col > 0 and col >= wanted_distance
    )