#include <bits/stdc++.h>
using namespace std;
int n, a, b, c, Max, nr = 2, l = 1, r = 2;
int main() {
  int i;
  scanf("%d", &n);
  if (n < 3) {
    printf("%d\n", n);
    return 0;
  } else
    scanf("%d%d", &a, &b);
  for (i = 3; i <= n; ++i) {
    scanf("%d", &c);
    if (c == a + b)
      ++r, ++nr;
    else
      l = i - 1, r = i, nr = 2;
    if (nr > Max) Max = nr;
    a = b, b = c;
  }
  printf("%d\n", Max);
  return 0;
}
