#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  std::vector<int> v(n);
  int start = 0, m = 0, len = 0;
  for (int i = 0; i < n; i++) cin >> v[i];
  if (n <= 2) {
    cout << n << endl;
    return 0;
  }
  for (int i = 2; i < n; i++) {
    if (v[i] == v[i - 1] + v[i - 2])
      len++;
    else
      len = 0;
    m = max(len, m);
  }
  m = max(m, len);
  cout << m + 2 << endl;
}
