#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
long long int rvsr(long long int n) {
  string s = to_string(n);
  reverse(s.begin(), s.end());
  stringstream obj(s);
  obj >> n;
  return n;
}
long long int power(long long int x, long long int y) {
  long long int res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long int logtwo(long long int n) {
  if (n == 1) return 0;
  return logtwo(n / 2) + 1;
}
long long int isprime(long long int n) {
  for (long long int c1 = 2; c1 * c1 <= n; c1++) {
    if (n % c1 == 0) {
      return 0;
    }
  }
  return 1;
}
long long int twop(long long int n) {
  long long int x = 0;
  while (n % 2 == 0) {
    n /= 2;
    x++;
  }
  return x;
}
template <typename T, typename T1>
T amin(T &a, T1 b) {
  if (b < a) a = b;
  return a;
}
void solve() {
  long long int n;
  cin >> n;
  int a[n];
  {
    for (long long int ii = 0; ii < n; ii++) cin >> a[ii];
  };
  int max = 0, cnt = 0;
  if (n <= 2) {
    cout << n;
  } else {
    for (int i = 2; i < n; i++) {
      if (a[i] == a[i - 1] + a[i - 2]) {
        cnt++;
      } else {
        if (cnt > max) max = cnt;
        cnt = 0;
      }
    }
    if (cnt > max) max = cnt;
    cout << max + 2;
  }
  return;
}
int main() {
  long long int t;
  t = 1;
  while (t--) solve();
  return 0;
}
