#include <fstream>
using namespace std;
ifstream f1("demfb.inp");
ofstream f2("demfb.out");
long i,a[100000],x = 0,y = 1,dem;
int main()
{
    f1 >> i;
    if (i == 1) {dem = i;return 0;}
    else dem = 2;
    for (long n = 0; n < i; n++) f1 >> a[n];
    for (long n = 2; n < i; n++)
	{
		if (a[n] == a[x] + a[y]) {dem++; x = y; y = n;}
	}
	f2 << dem;
    return 0;
}
