#include <fstream>
#include <vector>
#include <cstdint>

using namespace std;

ifstream input("FSEQ.inp");
ofstream output("FSEQ.out");

int main()
{
	int n, t1, t2, max = -1, count = 2;
	input >> n;
	vector <int> a(n);
	for (int i = 0; i < n; ++i)
	{
		input >> a[i];
	}
	a.push_back(INT32_MIN);
	t1 = a[0];
	t2 = a[1];
	for (int i = 2; i <= n; ++i)
	{
		if (a[i] == t1 + t2)
		{
			count++;
		}
		else
		{
			if (count > max && count != 2)
			{
				max = count;
			}
		}
		t1 = t2;
		t2 = a[i];
	}
	output << max;
	input.close();
	output.close();
	return 0;
}