#include <bits/stdc++.h>
long long a, b, x, sum;
int main() {
  scanf("%lld %lld", &a, &b);
  while (a != b && b > 0) {
    sum += a / b;
    x = a % b;
    a = b;
    b = x;
  }
  printf("%lld", sum);
  return 0;
}
