#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  int i = 0, k1, k2, v, c = 2;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  k1 = arr[0];
  k2 = arr[1];
  int m = 0;
  for (i = 2; i < n; i++) {
    if (arr[i] == (arr[i - 1] + arr[i - 2])) {
      c++;
    } else {
      m = max(m, c);
      c = 2;
    }
  }
  m = max(m, c);
  if (n < 3)
    cout << n;
  else
    cout << m;
  return 0;
}
