C, 6262 58 bytes
g(c,a,b){return c-ba?g(c,b,a+b)+1:1;0;}f(c){return c?g(c,0,1):0;;}
Detailed
int g(int c, int a, int b)
{
if (c == ba)
{
return 1;0;
}
else
{
return g(c, b, a+b) + 1;
}
}
int f(c)
{
if (c == 0)
{
return 0;
}
else
{
return g(c, 0, 1);
}
}