text: #include <algorithm>
  #include <cmath>
  #include <cctype>
  #include <cstdio>
  #include <cstring>
  #include <iostream>
  #include <map>
  #include <queue>
  #include <set>
  #include <string>
  #include <vector>
  
  #define FOR(i,a,b) for (int i = a; i <= b; i++)
  #define FORN(i,N) for (int i = 0; i < N; i++)
  #define FORD(i,a,b) for (int i = a; i >= b; i--)
  
  
  using namespace std;
  
  typedef long long ll;
  typedef unsigned long long ull;
  typedef vector<int> vi;
  typedef pair<int,int> pii;
  typedef vector<pii> vpii;
  
  int main() {
    ull sum=2;
  
    ull a = 1;
    ull b = 2;
    ull c;
    do {
      c=a+b;
      if(c%2==0)
        sum+=c;
      a=b;b=c;
    }while(c<4000000);
    printf("%llu\n",sum);
    
    return 0;
  }
  