#include <bits/stdc++.h>
using namespace std;
long long int a, b;
long long int mn, mx, s = 0;
int main() {
  cin >> a >> b;
  mx = max(a, b);
  mn = min(a, b);
  while (mx - mn > 0) {
    s += mx / mn;
    mx = mx % mn;
    if (mx == 0) {
      s + mx;
      break;
    }
    if (mx < mn) {
      long long int c = mx;
      mx = mn;
      mn = c;
    }
  }
  cout << s << endl;
  return 0;
}
