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