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