module Main where
fibonacci = map fst (iterate (\(n, m) -> (m, n+m)) (0, 1))
main = do
print (sum (filter even (takeWhile (<4000000) fibonacci)))