#include <bits/stdc++.h>
using namespace std;
long long f, g, h, i, ans, j, k, l, m, n, o, p, q, r, t, u, w, x, y, z, sz, ln,
    sm, mx, mn, ar[500005 + 5];
int main() {
  while (cin >> n) {
    f = 0;
    for (i = 1; i <= n; i++) {
      cin >> ar[i];
    }
    if (n == 1 || n == 2) {
      cout << n << endl;
      continue;
    }
    sm = mx = ans = 0;
    for (i = 3; i <= n; i++) {
      if (ar[i] == ar[i - 1] + ar[i - 2])
        sm++;
      else {
        ans = max(ans, sm);
        sm = 0;
      }
    }
    ans = max(ans, sm);
    cout << ans + 2 << endl;
  }
  return 0;
}
