#include <bits/stdc++.h>
using namespace std;
int countSteps(int m, int n, int init) {
  assert(n >= m);
  if (n == m) {
    if (n == 1)
      return init;
    else
      return 2000000;
  } else {
    int a = n - m;
    if (a > m)
      return countSteps(m, a, init + 1);
    else
      return countSteps(a, m, init + 1);
  }
}
int main() {
  int n;
  cin >> n;
  int m = n - 1;
  for (int i = 2 + (n % 2 == 0); i <= n / 2; i += 1 + (n % 2 == 0)) {
    m = min(countSteps(i, n - i, 1), m);
  }
  cout << m << endl;
  return 0;
}
