def count_words(my_string):
    """
    This function counts words
    :param my_string: str - A string of words or characters
    :return: int - length of words
    """
    if not isinstance(my_string, str):
        raise TypeError("only accepts strings")

    special_characters = ['-', '+', '\n']

    for character in special_characters:
        my_string = my_string.replace(character, " ")

    words = my_string.split()
    return len(words)