#include <bits/stdc++.h>
using namespace std;
int countSteps(int, int);
int main() {
  int n;
  cin >> n;
  int steps = n - 1;
  for (int i = 1; i < n; i++) {
    int res = countSteps(n, i);
    if (res != -1) steps = min(steps, res);
  }
  cout << steps;
  return 0;
}
int countSteps(int a, int b) {
  int cnt = 0;
  while ((a > 1 || b > 1) && a != b) {
    if (a > b)
      a -= b;
    else
      b -= a;
    cnt++;
  }
  return (a == 1 && b == 1 ? cnt : -1);
}
