#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  if (n == 1 || n == 2) {
    cout << n << '\n';
    return 0;
  }
  int ans = 2, temp = 2;
  for (int i = 2; i < n; i++) {
    if (a[i] == a[i - 1] + a[i - 2]) {
      temp++;
      ans = max(ans, temp);
    } else {
      temp = 2;
    }
  }
  cout << ans << '\n';
  return 0;
}
