#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void shivam() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  shivam();
  int n;
  cin >> n;
  int i, a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  int count = 2, ans = 0;
  if (n == 1) {
    cout << "1";
    return 0;
  }
  if (n == 2) {
    cout << "2";
    return 0;
  }
  for (i = 2; i < n; i++) {
    if (a[i] == (a[i - 2] + a[i - 1]))
      count++;
    else
      count = 2;
    ans = max(ans, count);
  }
  cout << ans;
  return 0;
}
