#include <bits/stdc++.h>
using namespace std;
string s;
int n,b,d,c,p,a[10000000],f1=1,f2=1,f3;
bool fibo[1000000];
void sang()
{
    fibo[1]=true;
    while (f1+f2<1000000)
    {
        f3=f1+f2;
        f1=f2;
        f2=f3;
        fibo[f3]=true;
    }
}
int main()
{
    freopen("DEMFB.inp","r",stdin);
    freopen("DEMFB.out","w",stdout);
    cin>>n;
    for (int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    sang();
    for (int i=0;i<n;i++)
    {
        if (fibo[a[i]]==true)
            d++;
    }
    cout<<d;
}

