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