#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, c, ans, a[N];
int main() {
  scanf("%d", &n);
  if (n == 1) return puts("1"), 0;
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  for (int i = 2; i < n; ++i) {
    if (a[i] ^ a[i - 1] + a[i - 2])
      c = 0;
    else
      ans = max(ans, ++c);
  }
  printf("%d\n", min(n, ans + 2));
  return 0;
}
