#include <bits/stdc++.h>
using namespace std;
void afify() {
  ios::sync_with_stdio(0);
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
const long long oo = (long long)10e9 + 7;
const double EPS = 1e-4;
int main() {
  afify();
  int n;
  cin >> n;
  vector<long long> v(n);
  for (int i = int(0); i < n; i++) cin >> v[i];
  long long res = min(2, n), fres = min(2, n);
  for (int i = int(2); i < n; i++) {
    if (v[i] == v[i - 1] + v[i - 2]) {
      res++;
    } else {
      fres = max(res, fres);
      res = 2;
    }
  }
  cout << max(fres, res) << endl;
  return 0;
}
