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