#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int main() {
  int n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  if (n <= 2) {
    cout << n << endl;
    return 0;
  }
  int count = 2, ans = 2;
  for (int i = 2; i < n; i++) {
    if (a[i] != (a[i - 1] + a[i - 2])) {
      ans = max(ans, count);
      count = 2;
    } else
      count++;
  }
  cout << max(ans, count) << endl;
  return 0;
}
