#include using namespace std; using ll = long long; using ul = unsigned long; unordered_map m; set st; ll f(ll n) { if (n == 0 || n == 1) { m[n] = 1; st.insert(1); return 1; } auto it = m.find(n); if (it != m.end()) return m[n]; ll res = f(n - 1) + f(n - 2); m[n] = res; st.insert(res); return res; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); vector a(5); for (auto&& ia : a) cin >> ia; f(72); int res{ 0 }; auto it = st.find(a[4]); if (it != st.end()) { for (int i = 4; i >= 0; --i) { if (a[i] != *it) break; if (i > 0 && a[i] == 1 && a[i - 1] == 1) ; else ++it; ++res; } } cout << res << "\n"; return 0; }