#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  if (n <= 2) {
    cout << n << endl;
    exit(0);
  }
  int l = 0, r = 2, ans = 2, c = 0;
  while (true) {
    if (r == n) break;
    if (v[r] == v[r - 1] + v[r - 2]) {
      ans++;
      r++;
    } else {
      l++;
      r++;
      c = max(c, ans);
      ans = 2;
    }
  }
  c = max(c, ans);
  cout << c << endl;
}
