import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int s = sc.nextInt();

    sc.close();

    boolean valid = true;

    Set<Integer> hashSet = new HashSet<Integer>();

    hashSet.add(s);

    int count = 2;

    while (valid) {

      if (s % 2 == 0) {
        s = s / 2;
      } else {
        s = 3 * s + 1;
      }

      if (hashSet.contains(s)) {
        valid = false;
      } else {
        hashSet.add(s);
        count++;
      }

    }

    System.out.println(count);

  }

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

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int s = sc.nextInt();

    sc.close();

    boolean valid = true;

    Set<Integer> hashSet = new HashSet<Integer>();

    hashSet.add(s);

    int count = 2;

    while (valid) {

      if (s % 2 == 0) {
        s = s / 2;
      } else {
        s = 3 * s + 1;
      }

      if (hashSet.contains(s)) {
        valid = false;
      } else {
        hashSet.add(s);
        count++;
      }

    }

    System.out.println(count);

  }

} Main public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int s = sc.nextInt();

    sc.close();

    boolean valid = true;

    Set<Integer> hashSet = new HashSet<Integer>();

    hashSet.add(s);

    int count = 2;

    while (valid) {

      if (s % 2 == 0) {
        s = s / 2;
      } else {
        s = 3 * s + 1;
      }

      if (hashSet.contains(s)) {
        valid = false;
      } else {
        hashSet.add(s);
        count++;
      }

    }

    System.out.println(count);

  } main {

    Scanner sc = new Scanner(System.in);

    int s = sc.nextInt();

    sc.close();

    boolean valid = true;

    Set<Integer> hashSet = new HashSet<Integer>();

    hashSet.add(s);

    int count = 2;

    while (valid) {

      if (s % 2 == 0) {
        s = s / 2;
      } else {
        s = 3 * s + 1;
      }

      if (hashSet.contains(s)) {
        valid = false;
      } else {
        hashSet.add(s);
        count++;
      }

    }

    System.out.println(count);

  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int s = sc.nextInt(); s sc.nextInt() sc.nextInt sc sc.close() sc.close sc boolean valid = true; valid true Set<Integer> hashSet = new HashSet<Integer>(); hashSet new HashSet<Integer>() hashSet.add(s) hashSet.add hashSet s int count = 2; count 2 while (valid) {

      if (s % 2 == 0) {
        s = s / 2;
      } else {
        s = 3 * s + 1;
      }

      if (hashSet.contains(s)) {
        valid = false;
      } else {
        hashSet.add(s);
        count++;
      }

    } valid {

      if (s % 2 == 0) {
        s = s / 2;
      } else {
        s = 3 * s + 1;
      }

      if (hashSet.contains(s)) {
        valid = false;
      } else {
        hashSet.add(s);
        count++;
      }

    } if (s % 2 == 0) {
        s = s / 2;
      } else {
        s = 3 * s + 1;
      } s % 2 == 0 s % 2 s 2 0 {
        s = s / 2;
      } s = s / 2 s s / 2 s 2 {
        s = 3 * s + 1;
      } s = 3 * s + 1 s 3 * s + 1 3 * s 3 s 1 if (hashSet.contains(s)) {
        valid = false;
      } else {
        hashSet.add(s);
        count++;
      } hashSet.contains(s) hashSet.contains hashSet s {
        valid = false;
      } valid = false valid false {
        hashSet.add(s);
        count++;
      } hashSet.add(s) hashSet.add hashSet s count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int s = sc.nextInt();

    sc.close();

    boolean valid = true;

    Set<Integer> hashSet = new HashSet<Integer>();

    hashSet.add(s);

    int count = 2;

    while (valid) {

      if (s % 2 == 0) {
        s = s / 2;
      } else {
        s = 3 * s + 1;
      }

      if (hashSet.contains(s)) {
        valid = false;
      } else {
        hashSet.add(s);
        count++;
      }

    }

    System.out.println(count);

  }

} public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int s = sc.nextInt();

    sc.close();

    boolean valid = true;

    Set<Integer> hashSet = new HashSet<Integer>();

    hashSet.add(s);

    int count = 2;

    while (valid) {

      if (s % 2 == 0) {
        s = s / 2;
      } else {
        s = 3 * s + 1;
      }

      if (hashSet.contains(s)) {
        valid = false;
      } else {
        hashSet.add(s);
        count++;
      }

    }

    System.out.println(count);

  }

} Main
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    int s = sc.nextInt();

    sc.close();

    boolean valid = true;

    Set<Integer> hashSet = new HashSet<Integer>();

    hashSet.add(s);

    int count = 2;

    while (valid) {

      if (s % 2 == 0) {
        s = s / 2;
      } else {
        s = 3 * s + 1;
      }

      if (hashSet.contains(s)) {
        valid = false;
      } else {
        hashSet.add(s);
        count++;
      }

    }

    System.out.println(count);

  }

}