#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long ar[n + 2];
  for (int i = 1; i <= n; i++) {
    cin >> ar[i];
  }
  if (n == 1) {
    cout << 1 << endl;
  } else if (n == 2) {
    cout << 2 << endl;
  } else {
    int c = 0, d = 0;
    for (int i = 3; i <= n; i++) {
      if (ar[i] == (ar[i - 1] + ar[i - 2])) {
        c++;
      } else {
        d = max(c, d);
        c = 0;
      }
    }
    cout << max(c, d) + 2 << endl;
  }
}
