#include <bits/stdc++.h>
using namespace std;
bool naoPode;
int passos(int a, int b) {
  int qtd = 0;
  while (a != 1 || b != 1) {
    if (a < 1 || b < 1) {
      naoPode = true;
      break;
    }
    if (a > b)
      a = a - b;
    else
      b = b - a;
    qtd++;
  }
  return qtd;
}
int tenta(int n) {
  int a = n - 1;
  int m = n;
  while (a > 0) {
    naoPode = false;
    int r = passos(a, n);
    if (!naoPode) m = r < m ? r : m;
    a--;
  }
  return m;
}
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    if (n == 1)
      printf("0\n");
    else
      printf("%d\n", tenta(n));
  }
  return 0;
}
