#include <bits/stdc++.h>
using namespace std;
void vin(vector<int> &v, int n) {
  long long temp;
  while (n--) {
    cin >> temp;
    v.push_back(temp);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v;
  vin(v, n);
  vector<int> a(n, 0);
  int ind;
  a[0] = 1;
  if (n > 1) a[1] = 1;
  for (int i = 2; i < n; i++) {
    if (v[i] == v[i - 1] + v[i - 2]) a[i] = 1;
  }
  int ans = 0;
  ind = 2;
  int aa = 0;
  while (ind < n) {
    if (a[ind] == 1) {
      ans++;
      ind++;
    }
    aa = max(ans, aa);
    if (a[ind] == 0) {
      ans = 0;
      ind++;
    }
  }
  if (n > 1)
    cout << aa + 2;
  else
    cout << 1;
  return 0;
}
