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