euler 17 in haskell, counting words