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