import System.IO sum35 i acc max | i >= max = acc | rem i 3 == 0 ||rem i 5 == 0 = sum35 (i+1) (acc+i) max | otherwise = sum35 (i+1) acc max main = print (sum35 1 0 1000)