#include <bits/stdc++.h>
using namespace std;
int M = 10e9 + 7;
long long a[523456];
int main() {
  int n, mx = 2, ans = -100;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (n < 3)
    cout << n << endl;
  else {
    for (int i = 2; i < n; i++) {
      if (a[i] == a[i - 1] + a[i - 2])
        mx++;
      else {
        ans = max(ans, mx);
        mx = 2;
      }
    }
    ans = max(ans, mx);
    cout << ans << endl;
  }
  return 0;
}
