#include <bits/stdc++.h>
using namespace std;
double EPS = 1e-9;
int INF = 1000000005;
long long INFF = 1000000000000000005LL;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<long long> v(n);
  for (int i = (0); i < (n); i++) {
    cin >> v[i];
  }
  int start = 0;
  int index = 2;
  int ans = 0;
  while (index < n) {
    while ((v[index] == v[index - 1] + v[index - 2]) and index < n) {
      index++;
    }
    ans = max(ans, index - start);
    start = index - 1;
    index++;
  }
  if (ans < 3) {
    if (n == 1)
      ans = 1;
    else
      ans = 2;
  }
  cout << ans << endl;
  return 0;
}
