cheap problem 13 in haskell