#include <bits/stdc++.h>
long int ar[100008];
int main() {
  long int i, j, k, l, m, n, p, q, r;
  scanf("%ld", &n);
  for (i = 0; i < n; i++) scanf("%ld", &ar[i]);
  if (n == 1)
    printf("1\n");
  else if (n == 2)
    printf("2\n");
  else {
    m = 2;
    i = 2;
    k = 0;
    while (1) {
      if (i >= n) {
        if (k > m) m = k;
        break;
      } else {
        if (ar[i] == (ar[i - 1] + ar[i - 2]) && k == 0)
          k += 3;
        else if (ar[i] == (ar[i - 1] + ar[i - 2]) && k > 0)
          k++;
        else {
          if (k > m) m = k;
          k = 0;
        }
        i++;
      }
    }
    printf("%ld\n", m);
  }
  return (0);
}
