#include <iostream>
using namespace std;
int main() {
int tab[100000000];
int n, ile=0;
cin >> n;
for(int i=0;i<n;i++) {
cin >> tab[i];
}
for(int i=2;i<n;i++) {
if(tab[i]==tab[i-1] + tab[i-2]) {
ile++;
}
}
cout << ile;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkKCWludCB0YWJbMTAwMDAwMDAwXTsKCWludCBuLCBpbGU9MDsKCWNpbiA+PiBuOwoJZm9yKGludCBpPTA7aTxuO2krKykgewoJCWNpbiA+PiB0YWJbaV07Cgl9Cglmb3IoaW50IGk9MjtpPG47aSsrKSB7CgkJaWYodGFiW2ldPT10YWJbaS0xXSArIHRhYltpLTJdKSB7CgkJCWlsZSsrOwoJCX0KCX0KCWNvdXQgPDwgaWxlOwoKCXJldHVybiAwOwp9