#include <bits/stdc++.h>
using namespace std;
int ans = (int)(2e5 + 10), n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int a = n, b = i, cnt = 0;
    while (a != 1 or b != 1) {
      if (a < 1 or b < 1) {
        cnt = (int)(2e5 + 10);
        break;
      }
      if (a > b)
        a -= b;
      else
        b -= a;
      cnt++;
    }
    ans = min(cnt, ans);
  }
  cout << ans << endl;
  return 0;
}
