def count(value, sub, start=None, end=None):
    """
    Return the number of non-overlapping occurrences of substring sub in the range [start, end].
    Optional arguments start and end are interpreted as in slice notation.
    """
    return value.count(sub, start, end)