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