#include <bits/stdc++.h>
const double pi = acos(-1);
using namespace std;
int n, k;
int a[100000];
int len(int l, int r) { return r - l + 1; }
int main() {
  int l, r, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ans = min(2, n);
  l = 0;
  r = 0;
  for (int i = 2; i < n; i++) {
    if (a[i] == a[i - 1] + a[i - 2])
      r = i;
    else {
      ans = max(ans, len(l, r));
      r = i;
      l = r - 1;
    }
  }
  ans = max(ans, len(l, r));
  cout << ans;
  return 0;
}
