#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans = 1e9;
  for (int i = 1; i <= n; i++) {
    int x = i;
    int y = n;
    int cnt = 0;
    while (x != y) {
      if (x > y)
        x -= y;
      else
        y -= x;
      cnt++;
    }
    if (x == 1) {
      ans = min(ans, cnt);
    }
  }
  cout << ans << endl;
}
