1. 

/*
* ACM Contest training
* Problem: 10183 - How Many Fibs?
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=13&problem=1124
*
* @author Christoph Goettschkes
* @version 1.0, 01/06/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 0.212
*/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.math.BigInteger;

class Main {

static BigInteger[] fibs = new BigInteger[479];

public static void main(String[] args) throws Exception {
pre();
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
BigInteger first = new BigInteger(tokenizer.nextToken());
BigInteger second = new BigInteger(tokenizer.nextToken());

while (first.compareTo(BigInteger.ZERO) != 0 || second.compareTo(BigInteger.ZERO) != 0) {
int counter = 0;
for (BigInteger cur : fibs) {
if (cur.compareTo(second) > 0)
break;
if (cur.compareTo(first) >= 0)
counter++;
}

System.out.println(counter);

tokenizer = new StringTokenizer(reader.readLine());
first = new BigInteger(tokenizer.nextToken());
second = new BigInteger(tokenizer.nextToken());
}
}

static void pre() {
BigInteger first = BigInteger.ONE;
BigInteger last = first.add(BigInteger.ONE);
BigInteger tmp;
BigInteger end = new BigInteger("10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000");
int counter = 0;

while (true) {
fibs[counter] = first;
tmp = first;
first = last;
last = tmp.add(last);
if (first.compareTo(end) >= 0) {
break;
}
counter++;
}
}
}