#include <bits/stdc++.h>
using namespace std;
class LittleElephantAndDouble {
 public:
  string getAnswer(vector<int> A) {
    int n = A.size();
    int i;
    int dp[101];
    for (i = 0; i < n; i++) dp[i] = A[i];
    for (i = 0; i < n; i++) {
      while (dp[i] % 2 != 1) dp[i] /= 2;
    }
    int flat = 0;
    for (i = 1; i < n; i++)
      if (dp[0] != dp[i]) {
        flat = 1;
        break;
      }
    if (!flat)
      return "YES";
    else
      return "NO";
  }
};
int main() {
  int n, f[100010], i, l, r;
  cin >> n;
  for (i = 0; i < n; i++) cin >> f[i];
  if (n == 1 || n == 2) {
    cout << n << endl;
    return 0;
  }
  int _max = 0;
  l = 0;
  r = 0;
  for (i = 0; i < n - 2; i++) {
    if (f[i + 2] == f[i] + f[i + 1])
      r = i + 2;
    else {
      if (_max < i - l + 2) _max = i - l + 2;
      l = i + 1;
    }
  }
  if (_max < r - l + 1) _max = r - l + 1;
  cout << _max << endl;
  return 0;
}
