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