#include <bits/stdc++.h>
using namespace std;
long long a[1000005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int mx = -1;
  int len = 2;
  bool g = 1;
  if (n == 1) {
    cout << 1;
    return 0;
  }
  for (int i = 2; i < n; i++) {
    if (a[i] == a[i - 1] + a[i - 2]) {
      len++;
      g = 1;
    } else {
      g = 0;
      mx = max(len, mx);
      if (i != n - 1 && a[i + 1] == a[i] + a[i - 1])
        len = 2;
      else
        len = 1;
    }
  }
  if (g)
    cout << max(mx, len);
  else
    cout << mx;
  return 0;
}
