#include <iostream>
using namespace std;
int main() {
int t1, t2;
cin >> t1 >> t2;
int length = 2; // 初始长度为2,包括t1和t2
while (t1 >= t2) {
int temp = t1 - t2; // 计算下一项
t1 = t2; // 更新t1
t2 = temp; // 更新t2
length++; // 序列长度加1
}
cout << length << endl;
return 0;
}