#include <bits/stdc++.h>
using namespace std;
int n;
int res = 0x7fffffff;
int cal(int a, int b) {
  if (a == b && b == 1) return 0;
  if (a < 1 || b < 1) return 500;
  return cal(max((a - b), b), min((a - b), b)) + 1;
}
int main() {
  cin >> n;
  int n2 = n / 2;
  int res = 0x7fffffff;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 1; i <= n2 + 1; i++) {
    res = min(res, cal(max(i, n - i), min(i, n - i)) + 1);
  }
  cout << res << endl;
  ;
  return 0;
}
