#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long powerM(long long x, long long y, long long M = mod) {
  long long v = 1;
  x = x % M;
  while (y > 0) {
    if (y & 1) v = (v * x) % M;
    y = y >> 1;
    x = (x * x) % M;
  }
  return v;
}
long long power(long long x, long long y) {
  long long v = 1;
  while (y > 0) {
    if (y & 1) v = v * x;
    y = y >> 1;
    x = x * x;
  }
  return v;
}
void solve() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long len = 2, mx = 2;
  if (n == 1) mx = 1;
  if (n == 2) mx = 2;
  for (long long i = 2; i < n; i++) {
    if (a[i] == a[i - 1] + a[i - 2]) {
      len++;
    } else {
      len = 2;
    }
    mx = max(mx, len);
  }
  cout << mx << endl;
  return (0);
}
