#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, res, s, a, b;
  cin >> n;
  res = n - 1;
  for (i = 1; i < n; i++) {
    s = 0;
    a = n;
    b = i;
    while (a != b) {
      if (a > b)
        a = a - b;
      else
        b = b - a;
      s++;
    }
    if (a == 1 && b == 1)
      if (s < res) res = s;
  }
  printf("%d\n", res);
}
