#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, res = 0;
  cin >> a >> b;
  while (a != b && b != 0) {
    long long r = a / b;
    long long t = a - r * b;
    a = max(b, t);
    b = min(b, t);
    res += r;
  }
  cout << res << endl;
  return 0;
}
