Получите количество вхождений независимого от корпуса подстроения Python

import re
_, count = re.subn(r'hello', '', astring, flags=re.I)
print('Found', count, 'occurrences of "hello"')
Difficult Dormouse