#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b);
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int modulo(long long int a, long long int b) {
  long long int r = a % b;
  return r < 0 ? r + b : r;
}
long long int longrem(string k, long long int n) {
  int now = 0;
  for (int i = 0; i < k.size(); i++) {
    now = (now * 10) % n;
    now = (now + k[i] - '0') % n;
  }
  return now;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n == 1) {
    cout << "1" << endl;
    return 0;
  }
  if (n == 2) {
    cout << "2" << endl;
    return 0;
  }
  long long int maxx = 2, j = 2, sum = 2;
  for (int i = 0; i < n - 2; i++) {
    if (a[i + 2] == a[i + 1] + a[i]) {
      sum++;
      maxx = max(maxx, sum);
    } else {
      maxx = max(maxx, sum);
      sum = 2;
    }
  }
  cout << maxx;
}
