#include <bits/stdc++.h>
using namespace std;
vector<int> data(1e5 + 5), dp(1e5 + 5, 0);
int n, ans = 0, l = 0;
int main(void) {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> data[i];
  }
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (n == 2) {
    cout << 2 << endl;
    return 0;
  }
  for (int i = 3; i <= n; ++i) {
    if (data[i] == data[i - 2] + data[i - 1]) {
      dp[i] = 1;
    }
  }
  for (int i = 3; i <= n; ++i) {
    if (dp[i] == 1) {
      ++l;
    } else {
      ans = max(ans, l + 2);
      l = 0;
    }
  }
  ans = max(ans, l + 2);
  cout << ans << endl;
  return 0;
}
