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