#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 1e5 + 5;
int maze[maxn];
int main() {
  int n;
  cin >> n;
  int len = 2, ans = 2;
  for (int i = 0; i < n; i++) {
    cin >> maze[i];
  }
  if (n <= 2)
    cout << n << endl;
  else {
    for (int i = 2; i < n; i++) {
      if (maze[i] == maze[i - 1] + maze[i - 2])
        len++;
      else
        len = 2;
      ans = max(ans, len);
    }
    cout << ans << endl;
  }
  return 0;
}
