import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    list.add(N);
    while (true) {
      if (N % 2 == 0) {
        N /= 2;
      } else {
        N = N * 3 + 1;
      }
      if (list.contains(N)) {
        list.add(N);
        System.out.println(list.size());
        break;
      } else {
        list.add(N);
      }
    }
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    list.add(N);
    while (true) {
      if (N % 2 == 0) {
        N /= 2;
      } else {
        N = N * 3 + 1;
      }
      if (list.contains(N)) {
        list.add(N);
        System.out.println(list.size());
        break;
      } else {
        list.add(N);
      }
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    list.add(N);
    while (true) {
      if (N % 2 == 0) {
        N /= 2;
      } else {
        N = N * 3 + 1;
      }
      if (list.contains(N)) {
        list.add(N);
        System.out.println(list.size());
        break;
      } else {
        list.add(N);
      }
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    list.add(N);
    while (true) {
      if (N % 2 == 0) {
        N /= 2;
      } else {
        N = N * 3 + 1;
      }
      if (list.contains(N)) {
        list.add(N);
        System.out.println(list.size());
        break;
      } else {
        list.add(N);
      }
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc ArrayList<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() list.add(N) list.add list N while (true) {
      if (N % 2 == 0) {
        N /= 2;
      } else {
        N = N * 3 + 1;
      }
      if (list.contains(N)) {
        list.add(N);
        System.out.println(list.size());
        break;
      } else {
        list.add(N);
      }
    } true {
      if (N % 2 == 0) {
        N /= 2;
      } else {
        N = N * 3 + 1;
      }
      if (list.contains(N)) {
        list.add(N);
        System.out.println(list.size());
        break;
      } else {
        list.add(N);
      }
    } if (N % 2 == 0) {
        N /= 2;
      } else {
        N = N * 3 + 1;
      } N % 2 == 0 N % 2 N 2 0 {
        N /= 2;
      } N /= 2 N 2 {
        N = N * 3 + 1;
      } N = N * 3 + 1 N N * 3 + 1 N * 3 N 3 1 if (list.contains(N)) {
        list.add(N);
        System.out.println(list.size());
        break;
      } else {
        list.add(N);
      } list.contains(N) list.contains list N {
        list.add(N);
        System.out.println(list.size());
        break;
      } list.add(N) list.add list N System.out.println(list.size()) System.out.println System.out System System.out list.size() list.size list break; {
        list.add(N);
      } list.add(N) list.add list N String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    list.add(N);
    while (true) {
      if (N % 2 == 0) {
        N /= 2;
      } else {
        N = N * 3 + 1;
      }
      if (list.contains(N)) {
        list.add(N);
        System.out.println(list.size());
        break;
      } else {
        list.add(N);
      }
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    list.add(N);
    while (true) {
      if (N % 2 == 0) {
        N /= 2;
      } else {
        N = N * 3 + 1;
      }
      if (list.contains(N)) {
        list.add(N);
        System.out.println(list.size());
        break;
      } else {
        list.add(N);
      }
    }
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    ArrayList<Integer> list = new ArrayList<Integer>();
    list.add(N);
    while (true) {
      if (N % 2 == 0) {
        N /= 2;
      } else {
        N = N * 3 + 1;
      }
      if (list.contains(N)) {
        list.add(N);
        System.out.println(list.size());
        break;
      } else {
        list.add(N);
      }
    }
  }
}
