#include #include using namespace std; #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define rep(i,a,b) for(LL i = a;ib; i--) #define tobirep(i,a,b,c) for(LL i = a;ib; i-=c) #define INF ((1LL<<62)-(1LL<<31)) #define ooki 9223372036854775807 #define tii -9223372036854775808 typedef long long LL; int main(){ ios::sync_with_stdio(0);cin.tie(nullptr); LL fib[75]; fib[0] = 1; fib[1] = 1; for (int i = 2; i < 75; i++) { fib[i] = fib[i - 1] + fib[i - 2]; } vector a(5); for (int i = 0; i < 5; i++) {cin >> a[i];} reverse(a.begin(), a.end()); int maxi = 0; for (int i = 0; i < 70; i++) { int cnt = 0; for (int j = 0; j < 5; j++) { if (a[j] != fib[i + j]) break; cnt++; } maxi = max(maxi, cnt); } cout << maxi << endl; }