#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  long long array[n];
  for (long long i = 0; i < n; i++) cin >> array[i];
  if (n == 1 || n == 2) cout << n << endl, exit(0);
  long long ans = 2, temp = 2;
  for (long long i = 2; i < n; i++) {
    if (array[i] == array[i - 1] + array[i - 2])
      temp++;
    else
      temp = 2;
    ans = max(ans, temp);
  }
  cout << ans << endl;
  return 0;
}
