#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, scount = 0, curr, currMax = 2;
  long long int ns[2] = {0, 0};
  cin >> n;
  if (n < 2) currMax = n;
  for (int i = 1; i <= n; i++) {
    cin >> curr;
    if (i > 2) {
      if (ns[0] + ns[1] == curr) {
        if (scount == 0)
          scount = 3;
        else
          scount++;
        if (scount >= currMax) currMax = scount;
      } else {
        scount = 0;
      }
      ns[0] = ns[1];
      ns[1] = curr;
    } else {
      ns[i - 1] = curr;
      scount++;
    }
  }
  cout << currMax;
  return 0;
}
