#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-9;
int key;
int solve(int a, int b) {
  int ret = 0;
  while (a != b && ret < key) {
    int ta = a - b, tb = b;
    if (ta < tb) swap(ta, tb);
    a = ta, b = tb;
    ++ret;
  }
  return a == 1 ? ret : 1e8;
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    key = n - 1;
    for (int i = 1; i < n; ++i) {
      key = min(key, solve(n, i));
    }
    printf("%d\n", key);
  }
  return 0;
}
