#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[100005], i, j, m, n, ans = 0, pos = 1;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 3; i <= n;) {
    if (a[i] == a[i - 1] + a[i - 2]) {
      while (a[i] == a[i - 1] + a[i - 2] && i <= n) {
        i++;
      }
      ans = max(i - pos, ans);
      pos = i - 2;
    } else
      i++, pos = i - 2;
  }
  cout << max(ans, min(n, 2));
  return 0;
}
