import java.io.*;
import java.util.*;
import java.math.*;
public class Main {
       public static void main(String args[])
       {
    	   Scanner cin=new Scanner(System.in);
    	   BigInteger f[]=new BigInteger[505];
    	   f[1]=BigInteger.valueOf(1);
    	   f[2]=BigInteger.valueOf(2);
    	   for(int i=3;i<505;i++)
    	   {
    		   f[i]=f[i-1].add(f[i-2]);
    	   }
    	   BigInteger a,b;
    	   while(cin.hasNextBigInteger())
    	   {
    		   a=cin.nextBigInteger();
    		   b=cin.nextBigInteger();
    		   if(a.compareTo(BigInteger.ZERO)==0&&b.compareTo(BigInteger.ZERO)==0)
    		   {
    			   break;
    		   }
    		   int count=0;
    		   for(int i=1;i<505;i++)
    		   {
    			   if(f[i].compareTo(b)>0)
    				   break;
    			   if(f[i].compareTo(a)>=0&&f[i].compareTo(b)<=0)
    			   {
    				   count++;
    			   }
    		   }
    		   System.out.println(count);
    	   }
       }
}

  

posted on 2011-09-23 17:00  枫叶飘泪  阅读(236)  评论(0编辑  收藏  举报