#include <bits/stdc++.h>
using namespace std;
int n, i, m, ma, t, r;
int x[100005];
bool check(int k) {
  int i = k + 2;
  t = 0;
  while (i < n) {
    if (x[i] == x[i - 1] + x[i - 2])
      t++;
    else
      break;
    i++;
  }
  return t;
}
int main() {
  cin >> n;
  for (i = 0; i < n; i++) cin >> x[i];
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  r = 1;
  for (i = 0; i < n - 2; i++) {
    if (x[i] > x[i + 1]) r = 1;
    if (r == 1)
      if (check(i)) {
        ma = max(t, ma);
        r = 0;
      }
  }
  cout << ma + 2 << endl;
  return 0;
}
