#include <bits/stdc++.h>
int n;
int a[100001];
typedef struct {
  int len;
} segment;
int main(void) {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  if (n <= 2) {
    printf("%d", n);
    return 0;
  }
  segment max;
  max.len = 2;
  segment temp;
  temp.len = 2;
  for (int i = 2; i < n; ++i) {
    if (a[i] == a[i - 1] + a[i - 2])
      temp.len++;
    else {
      if (max.len < temp.len) max.len = temp.len;
      temp.len = 2;
    }
  }
  if (temp.len > max.len) max.len = temp.len;
  printf("%d", max.len);
  return 0;
}
