#include <bits/stdc++.h>
using namespace std;
int main() {
  long long ships = 0, temp = 0, a, b;
  cin >> a >> b;
  while (b != 0) {
    temp = a / b;
    ships += temp;
    a -= temp * b;
    if (a < b) swap(a, b);
  }
  cout << ships;
  return 0;
}
