#include #include #include using namespace std; int main(){ vector a(5); for(int i = 0; 5 > i; i++){ cin>>a[i]; } reverse(a.begin(),a.end()); int A = 1; int B = 1; while(a[0] > A){ A = A+B; swap(A,B); } int ans = 0; while(ans != 5 && a[ans] == A){ ans++; A = A+B; swap(A,B); } cout << ans << endl; }