#!/usr/bin/ruby
def sum(last, current, sum)
if current >= 4000000
return sum
end
if current % 2 == 0
sum += current
sum(current,last+ current, sum)
puts sum(0, 1, 0)