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