#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100005], ans = 2, l = 9999999, r;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (n == 1 || n == 2)
    cout << n << endl;
  else {
    for (int i = 3; i <= n; i++) {
      if (a[i] == a[i - 1] + a[i - 2]) {
        r = i;
        l = l > i - 2 ? i - 2 : l;
        ans = max(ans, r - l + 1);
      } else {
        r = i;
        l = i;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
