import Data.Text hiding (length)


countSubStrs str sub = length $ breakOnAll (pack sub) (pack str)

main = do
  print $ countSubStrs "the three truths" "th"
  print $ countSubStrs "ababababab" "abab"