Use KMP to count the number of appearance for a substring in a piece of text.