package in;
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);//大于a开始计数
if (flag>=0)
break;
d = e;
e = f;
}
while (true){
f = d.add(e);
flag = f.compareTo(b);
if (flag<=0)//少于b的+1
c = c.add(BigInteger.valueOf(1));
else
break;
d = e;
e = f;
}
System.out.println(c);
}
}
}