import java.util.*;
import java.math.*;

public class Main {
    //java大数水过
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        BigInteger f, a, b, f1, f2, cnt;
        int flag;
        while (true) {
            a = in.nextBigInteger();
            b = in.nextBigInteger();
            if (a.equals(BigInteger.ZERO) && b.equals(BigInteger.ZERO))
                break;
            f1 = BigInteger.ZERO;
            f2 = BigInteger.ONE;
            cnt = BigInteger.ZERO;
            flag = 0;
            while (true) {
                f = f1.add(f2);
                flag = f.compareTo(a);
                if (flag >= 0)
                    break;
                f1 = f2;
                f2 = f;
            }
            while (true) {
                f = f1.add(f2);
                flag = f.compareTo(b);
                if (flag > 0)
                    break;
                cnt = cnt.add(BigInteger.ONE);
                f1 = f2;
                f2 = f;
            }
            System.out.println(cnt);
        }
    }
}