#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T sqr(T t) {
  return t * t;
}
inline void files() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int n, a[100100];
int main() {
  files();
  int l = 0, r = 0;
  int ans = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 3; i <= n; i++) {
    if (a[i] == a[i - 1] + a[i - 2]) {
      if (l == 0) l = max(1, i - 2);
      r = i;
      ans = max(ans, r - l + 1);
    } else {
      l = 0;
      r = 0;
    }
  }
  ans = max(ans, min(n, 2));
  cout << ans;
}
