#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); vector a(5); rep(i,5) cin >> a[i]; reverse(a.begin(), a.end()); vector f(80, 0); f[0] = 1; f[1] = 1; for(int i = 2; i < 80; i++) f[i] = f[i - 1] + f[i - 2]; int n = 0; for(int i = 0; i < 80; i++) { int cur = 0; for(int j = 0; j < 5; j++) { if(a[j] == f[i + j]) { cur++; } else { break; } } n = max(n, cur); } cout << n << endl; }