#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  if (v.size() <= 2) {
    cout << v.size() << endl;
    return 0;
  }
  int ptr1 = 0, ptr2 = 2;
  int res = 0;
  while (ptr2 < n) {
    if (v[ptr2] == v[ptr2 - 1] + v[ptr2 - 2])
      ptr2++;
    else {
      res = max(res, (ptr2 - ptr1));
      ptr1 = ptr2 - 1;
      ptr2++;
    }
  }
  res = max(ptr2 - ptr1, res);
  cout << res;
  return 0;
}
