#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int ans = n - 1;
  for (int i = 1; i <= n; ++i) {
    int a = i, b = n, tmp = 0;
    while (1) {
      if (a == b) {
        if (a == 1) break;
        tmp = 1000000007;
        break;
      }
      if (a > b)
        a -= b;
      else
        b -= a;
      ++tmp;
    }
    ans = min(ans, tmp);
  }
  printf("%d\n", ans);
  return 0;
}
