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