// template metaprogramming
#include <iostream>

template <int n>
struct fibonacci {
  enum { value = fibonacci<n - 1>::value + fibonacci<n - 2>::value };
};

template <>
struct fibonacci<0> {
  enum { value = 0 };
};

template <>
struct fibonacci<1> {
  enum { value = 1 };
};

int main() { std::cout << fibonacci<40>::value << std::endl; }