#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, s, n, x, y, i = 0, j = 0, k = 0, count = 0, ans = 0;
  cin >> n;
  vector<long long int> v;
  for (i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  if (n < 3) {
    cout << n;
  } else {
    x = 0;
    for (i = 2; i < n; i++) {
      if (v[i] != v[i - 1] + v[i - 2]) {
        x = i - 1;
      }
      ans = max(i - x + 1, ans);
    }
    cout << ans;
  }
  return 0;
}
