#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long infLL = 0x3f3f3f3f3f3f3f3fLL;
const int hash_mod = 1000037;
const double pi = acos(-1);
const double eps = 1e-10;
const int maxn = 100000 + 5;
int n;
int a[maxn];
bool f[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  for (int i = 2; i < n; ++i) f[i] = (a[i] == a[i - 1] + a[i - 2]);
  int res = min(n, 2);
  for (int i = 2; i < n; ++i)
    if (f[i]) {
      int j = i + 1;
      while (j < n && f[j]) ++j;
      res = max(res, j - i + 2);
      i = j;
    }
  printf("%d\n", res);
  return 0;
}
