//* Problem  : 1345 - How Many Fibs?
//* Contest  : acm.tju.edu.cn
//* Type     : Solution
//* Date     : 2007.07.29
//* Author   : alt
//* Language : C++
//* Compiler : Microsoft Visual C++ 6.0

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>

#define LEN 110
#define MAX(a, b) ((a>=b)?a:b)

struct la10 {int len;int a[LEN];};

la10 t1, t2, t3;
la10 a, b;
int count;

void la10_printf(la10 *q)
{
	int i = 0;
	while ((i < LEN) && (!q->a[i])) i++;
	if (i == LEN) printf("0");
	printf("%i", q->a[i]); i++;
	while (i < LEN) {printf("%i", q->a[i]); i++;}
	printf("\n");
}

void la10_add(la10 *a, la10 *b, la10 *res)
{
	int carry = 0, i, len = MAX(a->len, b->len); res->len = len;
	for (i = LEN - 1; len > 0; len--, i--)
	{
		carry += a->a[i] + b->a[i];
		res->a[i] = carry % 10;
		carry /= 10;
	}
	if (carry) {res->a[i] = carry; res->len++;}
}

void la10_scanf(char *s, la10 *res)
{
	memset(res, 0, sizeof(la10));
	int len = strlen(s), i, r = LEN-1;
	for (i = len - 1; i >= 0; i--, r--)
	{
		res->a[r] = s[i] - '0';
	}
	res->len = len;
}

void la10_set(la10 *a, int value)
{
	memset(a, 0, sizeof(la10));
	int i = LEN - 1;
	while (value)
	{
		a->len++;
		a->a[i--] = value % 10;
		value /= 10;
	}
}

int la10_cmp(la10 *a, la10 *b)
{
	if (a->len != b->len) return (a->len - b->len);
	for (int i = LEN - a->len; i < LEN; i++)
		if (a->a[i] != b->a[i]) return (a->a[i] - b->a[i]);
	return 0;
}

char s[250];
char s1[150], s2[150];
int ia, ib;

int main()
{
	gets(s);
	while (strcmp(s, "0 0"))
	{
		count = 0;
		sscanf(s, "%s %s", s1, s2);
		if (strlen(s1)<3) 
		{
			sscanf(s1, "%i", &ia);
			if (ia <= 1) count+=2;
				else if (ia == 2) count++;
			if (strlen(s2)<3) sscanf(s2, "%i", &ib);
			if (ib == 1) count = 1;
		}
		la10_scanf(s1, &a);
		la10_scanf(s2, &b);
		//la10_printf(&a); la10_printf(&b);
		la10_set(&t1, 1); la10_set(&t2, 2); memset(&t3, 0, sizeof(t3));
		la10_add(&t1, &t2, &t3);
		while (la10_cmp(&t3, &a)<0)
		{
			memcpy(&t1, &t2, sizeof(t1));
			memcpy(&t2, &t3, sizeof(t2));
			la10_add(&t1, &t2, &t3);
	//		la10_printf(&t3);
		}
		while (la10_cmp(&t3, &b)<=0)
		{
			count++;
			memcpy(&t1, &t2, sizeof(t1));
			memcpy(&t2, &t3, sizeof(t2));
			la10_add(&t1, &t2, &t3);
	//		la10_printf(&t3);
		}
		printf("%i\n", count);
		gets(s);
	}
	

}