#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long a[100050];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int maks = 0;
  int x = min(2, n);
  int fib = x;
  for (int i = 0; i < n - 2; i++) {
    if (a[i] + a[i + 1] == a[i + 2])
      fib++;
    else {
      maks = max(maks, fib);
      fib = x;
    }
  }
  maks = max(maks, fib);
  cout << maks;
  return 0;
}
