#include<fstream>
using namespace std;
ifstream fi("demfb.inp");
ofstream fo("demfb.out");
long int n,mx = -2e9, i, fib1 = 1, fib2 = 1, fib=1,dem=0,a[10000],f[1000000];

kt(){
while (fib <= mx)
{
fib = fib1 + fib2;
fib2 = fib1;
fib1 = fib;
f[fib] = 1;
}
    return 0;}
int main()
{
fi>>n;
if(n==1){
    dem++;
}
for(i=0;i<n;i++)
{
    fi>>a[i];
    mx = max(mx,a[i]);
}
fill(f,f+mx,0);
f[1] = 1;
kt();
for(i=0;i<n;i++)
{
    if (a[i] > 0 && f[a[i]] == 1) {dem++;}
}
fo<<dem;
return 1;
}
