#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, len = 0;
  int a[100000];
  cin >> n;
  if (n <= 2)
    cout << n << endl;
  else {
    int l, r;
    for (i = 0; i < n; i++) cin >> a[i];
    r = 2;
    while (r < n) {
      l = r - 2;
      while (r < n && (a[r] == (a[r - 1] + a[r - 2]))) r++;
      if (len < r - l) len = r - l;
      r++;
    }
    if (len < 2) len = 2;
    cout << len << endl;
  }
  return 0;
}
