#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  int max_len = 2, temp = 0;
  bool new_ = true;
  for (int i = 0; i < n; i++) {
    if (i < n - 2) {
      if (v[i] + v[i + 1] == v[i + 2]) {
        if (!new_) {
          temp++;
        } else {
          new_ = false;
          temp = 3;
        }
        max_len = (max_len > temp ? max_len : temp);
      } else {
        new_ = true;
      }
    }
  }
  if (n <= 2) {
    max_len = n;
  }
  cout << max_len << endl;
  return 0;
}
