#include <bits/stdc++.h>
const long long INF = (long long)1e18 + 18;
const long long maxx = (long long)1e6 + 6;
using namespace std;
long long n, m, counter = 0, ans = -69;
signed main() {
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n <= 2) {
    cout << n << endl;
    return 0;
  }
  for (long long i = 2; i < n; i++) {
    if (a[i] == a[i - 1] + a[i - 2]) {
      while (a[i] == a[i - 1] + a[i - 2] && i < n) {
        counter++;
        i++;
      }
      ans = max(ans, counter + 2);
      counter = 0;
    }
  }
  if (ans == -69) {
    cout << "2" << endl;
    return 0;
  }
  cout << ans << endl;
  return 0;
}
