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