#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long int ans = 0;
  long long int l = 0, r = 2;
  if (n == 1) {
    cout << "1";
  } else if (n == 2) {
    cout << "2";
  } else {
    for (; r < n; ++r) {
      if (a[r] == a[r - 1] + a[r - 2]) {
        continue;
      } else {
        ans = max(ans, r - l);
        l = r - 1;
      }
    }
    cout << max(ans, r - l);
  }
  return 0;
}
