I have a strange problem with the following codewars Kata:

<https://www.codewars.com/kata/51e056fe544cf36c410000fb/train/python>

I haven't completed it, but I ran into a really strange problem with the string.count() method.

The count that I get with the method for word "an" is 8, eventhough it is only once in the string.

Advise would be much appreciated.

Here is my code:

```
import re

words = "In a village of La Mancha, the name of which I have no desire to call to \
mind, there lived not long since one of those gentlemen that keep a lance \
in the lance-rack, an old buckler, a lean hack, and a greyhound for \
coursing. An olla of rather more beef than mutton, a salad on most \
nights, scraps on Saturdays, lentils on Fridays, and a pigeon or so extra \
on Sundays, made away with three-quarters of his income."
# => ["a", "of", "on"]    

def top_3_words(text: str):
    text = re.sub('[^0-9a-zA-Z]+', ' ', text).strip(' ')
    arr = text.split(' ')
    dict = {value: text.count(value) for value in arr}

    result = []

    for _ in range(3):
        max_key = max(dict, key=dict.get)
        result.append(max_key)   
        dict.pop(max_key)
    print(result)

top_3_words(words)

```