#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, l, r, i, x, y, flag = 0, flag2 = 0;
  vector<long long int> v, f;
  vector<long long int>::iterator it;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
  if (n == 1 || n == 2) {
    cout << n;
    return 0;
  }
  l = 0;
  r = 0;
  for (i = 2; i < n; i++) {
    y = v[i - 1] + v[i - 2];
    if (v[i] == y && l == 0) {
      flag2 = 1;
      l = i;
      continue;
    } else if (v[i] == y && l != 0)
      continue;
    else if (v[i] != y && l == 0)
      continue;
    else if (v[i] != y && l != 0) {
      flag = 1;
      r = i;
      flag = 0;
      flag2 = 0;
      f.push_back(r - l + 2);
      l = 0;
      r = 0;
    }
  }
  if (flag == 0 && flag2 == 1) {
    r = n;
    f.push_back(r - l + 2);
  }
  if (f.empty()) {
    cout << 2;
    return 0;
  }
  it = max_element(f.begin(), f.end());
  cout << *it;
  return 0;
}
