#include<iostream>
#include<algorithm>
using namespace std;
int main() {
int x, y;
int ans = 0;
cin >> x >> y;
while (x != y) {
ans++;
if (x > y)
swap(x, y);
y -= x;
}
ans++;
cout << ans;
system("pause");
return 0;
}
#include<iostream>
#include<algorithm>
using namespace std;
int main() {
int x, y;
int ans = 0;
cin >> x >> y;
while (x != y) {
ans++;
if (x > y)
swap(x, y);
y -= x;
}
ans++;
cout << ans;
system("pause");
return 0;
}