import re


def count(item, string, case_sensitive=False):
    """Returns the exact number of how many times `item` is found in `string`.

    :param item: item to count the occurrences of in `string`
    :param string: string to count occurrences of `item` in.
    :param case_sensitive: if set to `True`, the search after `item` is
                           case-sensetive.
    """
    flags = False if case_sensitive else re.I
    return len(re.findall(str(item), string, flags))