#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  if (n == 1) {
    cout << '1';
    return 0;
  }
  int s = 0, max = 0;
  for (int i = 2; i < n; i++) {
    if (a[i] == (a[i - 1] + a[i - 2])) {
      s++;
    } else {
      if (s > max) {
        max = s;
      }
      s = 0;
    }
  }
  if (s > max) {
    max = s;
  }
  cout << max + 2;
  return 0;
}
