def get_dist(stroke_count, modes):
    """
    Get the distance to the closest mode.

    Parameters
    ----------
    stroke_count : int
    modes : list of int
    """
    dist = float('inf')
    for mode in modes:
        dist = min(dist, abs(mode - stroke_count))
    return dist