#include <bits/stdc++.h>
using namespace std;
int cal(int a, int b) {
  int cnt = 0;
  while (!(a == 1 && b == 1) && a > 0 && b > 0) {
    if (a > b)
      a = a - b;
    else
      b = b - a;
    cnt++;
  }
  if (a == 1 && b == 1)
    return cnt + 1;
  else
    return 0x3fffffff;
}
int main() {
  int n, res = 0x3fffffff;
  scanf("%d", &n);
  for (int i = 1; i < n / 2 + 1; i++) {
    int r = cal(n - i, i);
    if (r < res) res = r;
  }
  if (n == 1)
    printf("0\n");
  else
    printf("%d\n", res);
  return 0;
}
