#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  if (a.size() > 2) {
    a.push_back(-1);
    vector<long long> v;
    long long x = 2;
    for (long long i = 2; i <= n; i++) {
      if (a[i] != (a[i - 1] + a[i - 2])) {
        v.push_back(i - x);
        x = i + 1;
      }
    }
    sort(v.begin(), v.end());
    cout << v[v.size() - 1] + 2 << "\n";
  } else {
    cout << a.size() << "\n";
  }
}
