/*
project euler problem 2: 求fibonacci数列中,不超过4M的所有偶数之和。
answer: 4613732
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
vector<LL> all;
void init(void)
{
all.push_back(1);
all.push_back(2);
while(all.back() <= 4000000)
{
int n = all.size();
all.push_back(all[n - 1] + all[n - 2]);
}
}
int main(void)
{
LL ans = 0;
init();
for(auto& x: all)
if(x % 2 == 0) ans += x;
cout << ans << endl;
return 0;
}