#include <bits/stdc++.h>
using namespace std;
void slv() {
  int n;
  cin >> n;
  int a, b = 0;
  int ans = 9999999999, cnt;
  for (int i = 1; i <= n; i++) {
    cnt = 0;
    a = n;
    b = i;
    bool ind = true;
    while (a != 1 || b != 1) {
      if (a > b) {
        a -= b;
      } else if (b > a) {
        b -= a;
      } else {
        ind = false;
        break;
      }
      cnt++;
    }
    if (ind) ans = min(ans, cnt);
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T;
  T = 1;
  while (T--) slv();
  return 0;
}
