#include <bits/stdc++.h>
int getmin(int a, int b) {
  if (a == -1)
    return b;
  else if (b == -1)
    return a;
  else
    return a < b ? a : b;
}
int solve(int a, int b) {
  int tot = 0;
  while (a != 1 || b != 1) {
    tot++;
    if (!a || !b) return -1;
    if (a > b)
      a -= b;
    else
      b -= a;
  }
  return tot;
}
int main() {
  int n, ans = -1;
  scanf("%d", &n);
  for (int a = 1; a < n; a++) ans = getmin(ans, solve(a, n));
  if (ans == -1) ans++;
  printf("%d\n", ans);
  return 0;
}
