//
// main.cpp
// 5.2
//
// Created by Mr.Xue on 17/7/15.
// Copyright © 2017年 Mr.Xue. All rights reserved.
//
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#define max 10005
using namespace std;
string a[max];
string sum(string s1,string s2)
{
int len1=s1.length();
int len2=s2.length();
if(len2>len1)
{
string temp;
temp=s1;
s1=s2;
s2=temp;
}
for(int i=len1-1,j=len2-1;i>=0;i--,j--)
{
s1[i]=char(s1[i]+(j>=0?s2[j]-'0':0));
if(s1[i]-'0'>=10)
{
s1[i]=(s1[i]-'0')%10+'0';
if(i)
s1[i-1]++;
else
s1='1'+s1;
}
}
return s1;
}
int main()
{
string x;
string y;
a[1]='1';
a[2]='2';
for(int i=3;i<max;i++)
a[i]=sum(a[i-1],a[i-2]);
while(1)
{
cin>>x;
cin>>y;
if(x[0]=='0'&&y[0]=='0')
break;
int sum=0;
for(int i=1;i<max;i++)
{
if(((a[i].compare(x)>=0&&a[i].length()==x.length())
||a[i].length()>x.length())
&&((a[i].compare(y)<=0&&a[i].length()==y.length())
||a[i].length()<y.length()))
sum++;
if(a[i].length()>y.length())
break;
}
cout<<sum<<endl;
}
return 0;
}