#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  long long int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long int start = min(2, n), end = 0;
  long long int ans = 0;
  if (n <= 2) ans = n;
  long long int len = 2;
  while (start < n) {
    if (a[start] == a[start - 1] + a[start - 2]) {
      len++;
    } else {
      len = 2;
    }
    ans = max(ans, len);
    start++;
  }
  cout << ans;
}
