#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
ll a[123456];
void solve() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int ans = 0;
  if (n == 1)
    ans = 1;
  else {
    int reset_len = 2;
    for (int i = 3; i <= n; ++i) {
      if (a[i] == (a[i - 1] + a[i - 2])) {
        reset_len++;
        ans = max(ans, reset_len);
      } else
        reset_len = 2;
    }
    ans = max(ans, reset_len);
  }
  cout << ans;
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int tc = 1;
  while (tc--) solve();
  return 0;
}
