#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[100001];
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long flag = 0, flag1 = 0, st = -1, en = -1;
  long long mx = -1;
  for (long long i = 0; i < n - 2; ++i) {
    if (a[i + 2] == a[i + 1] + a[i]) {
      flag1 = 1;
      if (!flag) {
        flag = 1;
        st = i;
      }
      en = i + 2;
      continue;
    } else {
      flag = 0;
      if (mx < en - st + 1) {
        mx = en - st + 1;
      }
    }
  }
  mx = max(mx, en - st + 1);
  if (!flag1) {
    cout << min((long long)2, n);
  } else
    cout << mx << endl;
  return 0;
}
