#include <bits/stdc++.h>
using namespace std;
template <typename T>
string tostr(const T& t) {
  ostringstream os;
  os << t;
  return os.str();
}
long long data[100005];
int main() {
  int n;
  cin >> n;
  for (int i = (int)(0); i <= (int)(n - 1); ++i) {
    cin >> data[i];
  }
  int best = 1;
  if (n > 1) best = 2;
  int start = -1;
  for (int i = (int)(0); i <= (int)(n - 1); ++i) {
    if (data[i] == 0) {
      if (start == -1)
        start = i;
      else {
        int len = i - start + 1;
        best = max(best, len);
      }
    } else if (data[i] != 0) {
      if (start != -1) {
        start = -1;
      }
    }
  }
  for (int i = (int)(0); i <= (int)(n - 1); ++i) {
    int first = i;
    int last = i;
    for (int j = (int)(i + 2); j <= (int)(n - 1); ++j) {
      if (data[j] != data[j - 1] + data[j - 2]) {
        break;
      }
      last = j;
      if (last - first + 1 > 55) break;
    }
    best = max(best, last - first + 1);
  }
  cout << best << endl;
  return 0;
}
