#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];
  }
  int ans = 0;
  int c = 0;
  if (n == 1) {
    cout << 1;
    return 0;
  } else if (n == 2) {
    cout << 2;
    return 0;
  }
  for (int i = 2; i < n; i++) {
    if (a[i] == a[i - 1] + a[i - 2]) {
      c++;
      ans = max(ans, c);
    } else {
      c = 0;
    }
  }
  cout << ans + 2;
  return 0;
}
