Haskell solution for euler1.