#include <bits/stdc++.h>
using namespace std;
int cnt, ans;
int a[1000005];
int MX = 0;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 2; i < n; i++) {
    if (a[i] == a[i - 1] + a[i - 2]) {
      cnt++;
      ans = max(ans, cnt);
    } else
      cnt = 0;
  }
  if (n > 2)
    cout << ans + 2;
  else
    cout << n;
}
