#include <bits/stdc++.h>
using namespace std;
typedef long long int64;
typedef unsigned long long uint64;
const double pi = acos(-1.0);
const double eps = 1e-11;
const int MAXI = 0x7fffffff;
int in() {
  int x = 0, c;
  for (; (unsigned)((c = getchar()) - '0') >= 10;) {
    if (c == '-') return -in();
    if (!~c) throw ~0;
  }
  do {
    x = (x << 3) + (x << 1) + (c - '0');
  } while ((unsigned)((c = getchar()) - '0') < 10);
  return x;
}
int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  int a[n];
  for (int i = (0), _b = (n); i < _b; i++) cin >> a[i];
  if (n < 3) {
    cout << n;
    return 0;
  }
  int MAX, cnt;
  MAX = cnt = 0;
  for (int i = (2), _b = (n); i < _b; 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 0;
}
