#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  long long int n;
  std::cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) std::cin >> a[i];
  if (n < 3)
    std::cout << n << '\n';
  else {
    long long int c = 2, len;
    for (long long int i = 2; i < n; i++) {
      len = 2;
      if (a[i] == (a[i - 1] + a[i - 2])) {
        while ((a[i] == (a[i - 1] + a[i - 2])) && (i < n)) {
          len++;
          i++;
        }
        c = max(c, len);
      }
    }
    std::cout << c << '\n';
  }
  return 0;
}
