#include <bits/stdc++.h>
using namespace std;
void get_segment(int n) {
  if (n <= 2) {
    cout << n << endl;
    return;
  }
  long long arr[100005];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int len_seg = 2, max_len = 2;
  for (int i = 2; i < n; i++) {
    if (arr[i] == arr[i - 1] + arr[i - 2]) {
      len_seg++;
      max_len = max(max_len, len_seg);
    } else {
      len_seg = 2;
    }
  }
  cout << max_len << endl;
  return;
}
int main() {
  int n;
  cin >> n;
  get_segment(n);
  return (0);
}
