#include using namespace std; int main(){ vector fib(75), a(5); for(auto &&v:a)cin >> v; reverse(a.begin(), a.end()); fib[0] = fib[1] = 1; for(int i = 2; i < 75; i++)fib[i] = fib[i - 1] + fib[i - 2]; int st = lower_bound(fib.begin(), fib.end(), a[0]) - fib.begin(); if(st == 0 && a[1] == 2)st++; for(int i = 0; i < 5; i++){ if(a[i] != fib[st + i]){ cout << i << '\n'; return 0; } } cout << 5 << '\n'; }