//本题不多说就是用Java解决高精度问题
import java.io.*;
import java.math.*;
import java.util.*;
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
BigInteger a,b,c,d,e,f;
Scanner cin=new Scanner(new BufferedInputStream(System.in));
int flag;
while(true)
{
c = BigInteger.valueOf(0);
a=cin.nextBigInteger();
b=cin.nextBigInteger();
if(a.equals(BigInteger.valueOf(0))&&b.equals(BigInteger.valueOf(0)))
break;
d=BigInteger.valueOf(0);
e=BigInteger.valueOf(1);
while(true)
{
f=d.add(e);
flag=f.compareTo(a);
if(flag>=0)
break;
d=e;
e=f;
}
while(true)
{
f=d.add(e);
flag=f.compareTo(b);
if(flag<=0)
c=c.add(BigInteger.valueOf(1));
else
break;
d=e;
e=f;
}
System.out.println(c);
}
}
}