import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int[] a = new int[1000000];
    int n = 1;
    a[n] = s;

    Map<Integer, Integer> map = new HashMap<>();
    map.put(a[n],n);

    while (n > 0) {
      n++;

      if (a[n-1]%2 == 0) {
        a[n] = a[n-1] / 2;
      } else if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      }

      if (map.containsKey(a[n])) {
        System.out.println(n);
        break;
      } else {
        map.put(a[n],n);
      }
    }


  }

} import java.util.*; util.* java public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int[] a = new int[1000000];
    int n = 1;
    a[n] = s;

    Map<Integer, Integer> map = new HashMap<>();
    map.put(a[n],n);

    while (n > 0) {
      n++;

      if (a[n-1]%2 == 0) {
        a[n] = a[n-1] / 2;
      } else if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      }

      if (map.containsKey(a[n])) {
        System.out.println(n);
        break;
      } else {
        map.put(a[n],n);
      }
    }


  }

} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int[] a = new int[1000000];
    int n = 1;
    a[n] = s;

    Map<Integer, Integer> map = new HashMap<>();
    map.put(a[n],n);

    while (n > 0) {
      n++;

      if (a[n-1]%2 == 0) {
        a[n] = a[n-1] / 2;
      } else if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      }

      if (map.containsKey(a[n])) {
        System.out.println(n);
        break;
      } else {
        map.put(a[n],n);
      }
    }


  } main {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int[] a = new int[1000000];
    int n = 1;
    a[n] = s;

    Map<Integer, Integer> map = new HashMap<>();
    map.put(a[n],n);

    while (n > 0) {
      n++;

      if (a[n-1]%2 == 0) {
        a[n] = a[n-1] / 2;
      } else if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      }

      if (map.containsKey(a[n])) {
        System.out.println(n);
        break;
      } else {
        map.put(a[n],n);
      }
    }


  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc int[] a = new int[1000000]; a new int[1000000] 1000000 int n = 1; n 1 a[n] = s a[n] a n s Map<Integer, Integer> map = new HashMap<>(); map new HashMap<>() map.put(a[n],n) map.put map a[n] a n n while (n > 0) {
      n++;

      if (a[n-1]%2 == 0) {
        a[n] = a[n-1] / 2;
      } else if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      }

      if (map.containsKey(a[n])) {
        System.out.println(n);
        break;
      } else {
        map.put(a[n],n);
      }
    } n > 0 n 0 {
      n++;

      if (a[n-1]%2 == 0) {
        a[n] = a[n-1] / 2;
      } else if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      }

      if (map.containsKey(a[n])) {
        System.out.println(n);
        break;
      } else {
        map.put(a[n],n);
      }
    } n++ n if (a[n-1]%2 == 0) {
        a[n] = a[n-1] / 2;
      } else if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      } a[n-1]%2 == 0 a[n-1]%2 a[n-1] a n-1 n 1 2 0 {
        a[n] = a[n-1] / 2;
      } a[n] = a[n-1] / 2 a[n] a n a[n-1] / 2 a[n-1] a n-1 n 1 2 if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      } a[n-1]%2 != 0 a[n-1]%2 a[n-1] a n-1 n 1 2 0 {
        a[n] = 3 * a[n-1] + 1;
      } a[n] = 3 * a[n-1] + 1 a[n] a n 3 * a[n-1] + 1 3 * a[n-1] 3 a[n-1] a n-1 n 1 1 if (map.containsKey(a[n])) {
        System.out.println(n);
        break;
      } else {
        map.put(a[n],n);
      } map.containsKey(a[n]) map.containsKey map a[n] a n {
        System.out.println(n);
        break;
      } System.out.println(n) System.out.println System.out System System.out n break; {
        map.put(a[n],n);
      } map.put(a[n],n) map.put map a[n] a n n String[] args args public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int[] a = new int[1000000];
    int n = 1;
    a[n] = s;

    Map<Integer, Integer> map = new HashMap<>();
    map.put(a[n],n);

    while (n > 0) {
      n++;

      if (a[n-1]%2 == 0) {
        a[n] = a[n-1] / 2;
      } else if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      }

      if (map.containsKey(a[n])) {
        System.out.println(n);
        break;
      } else {
        map.put(a[n],n);
      }
    }


  }

} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int[] a = new int[1000000];
    int n = 1;
    a[n] = s;

    Map<Integer, Integer> map = new HashMap<>();
    map.put(a[n],n);

    while (n > 0) {
      n++;

      if (a[n-1]%2 == 0) {
        a[n] = a[n-1] / 2;
      } else if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      }

      if (map.containsKey(a[n])) {
        System.out.println(n);
        break;
      } else {
        map.put(a[n],n);
      }
    }


  }

} Main
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int[] a = new int[1000000];
    int n = 1;
    a[n] = s;

    Map<Integer, Integer> map = new HashMap<>();
    map.put(a[n],n);

    while (n > 0) {
      n++;

      if (a[n-1]%2 == 0) {
        a[n] = a[n-1] / 2;
      } else if (a[n-1]%2 != 0) {
        a[n] = 3 * a[n-1] + 1;
      }

      if (map.containsKey(a[n])) {
        System.out.println(n);
        break;
      } else {
        map.put(a[n],n);
      }
    }


  }

}
