#include <bits/stdc++.h>
using namespace std;
int num[100010];
long long ans[100010];
int main() {
  int T;
  int n, i, j, tt, L;
  while (cin >> n) {
    for (i = 1; i <= n; i++) scanf("%I64d", &ans[i]);
    if (n >= 2)
      tt = 2;
    else
      tt = 1;
    L = 1;
    for (i = 3; i <= n; i++) {
      if (ans[i] == ans[i - 1] + ans[i - 2]) continue;
      tt = max(tt, i - L);
      L = i - 1;
    }
    if (n >= 3) tt = max(i - L, tt);
    cout << tt << endl;
  }
  return 0;
}
