#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 777;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  if (n < 3) {
    cout << n << '\n';
    return 0;
  }
  int res = 0, mx = 0;
  for (int i = 0; i < n - 2; ++i) {
    if (a[i + 2] == a[i + 1] + a[i]) {
      ++res;
      mx = max(mx, res);
    } else
      res = 0;
  }
  cout << max(2, mx + 2) << '\n';
  return 0;
}
