Solve problem 53 using Haskell.