#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  if (n == 1) {
    cout << '1';
    return 0;
  } else if (n == 2) {
    cout << '2';
    return 0;
  }
  int s = 0;
  int max = 0;
  for (int i = 2; i < n; i++) {
    if (a[i] == a[i - 2] + a[i - 1])
      s++;
    else
      s = 0;
    if (s > max) max = s;
  }
  cout << max + 2;
  return 0;
}
