problem 15 in haskell