#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long int c = 0, m = 0;
  for (long long int i = 0; i < n; i++) {
    if (a[i] == 0) {
      c++;
      m = max(m, c);
    } else {
      c = 0;
    }
  }
  c = 0;
  for (long long int i = 0; i < n - 1; i++) {
    if (a[i] == 0 && a[i + 1] == 0) {
      continue;
    }
    long long int x = a[i], y = a[i + 1], z = 2;
    for (long long int j = i + 2; j < n; j++) {
      if (a[j] == x + y) {
        z++;
        x = y;
        y = a[j];
      } else {
        m = max(z, m);
        break;
      }
    }
    m = max(z, m);
  }
  if (n == 1) m = 1;
  cout << m;
}
