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