import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  int[] a = new int[1000000];
  Arrays.fill(a,0);
  a[n]=1;
  int cnt = 1;
  for(;;){
    if(n%2==0){
      n /= 2;
    }
    else{
      n = n*3 + 1;
    }
    if(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    }
  }
  System.out.println(cnt+1);
}}
       import java.util.*; util.* java public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  int[] a = new int[1000000];
  Arrays.fill(a,0);
  a[n]=1;
  int cnt = 1;
  for(;;){
    if(n%2==0){
      n /= 2;
    }
    else{
      n = n*3 + 1;
    }
    if(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    }
  }
  System.out.println(cnt+1);
}} Main public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  int[] a = new int[1000000];
  Arrays.fill(a,0);
  a[n]=1;
  int cnt = 1;
  for(;;){
    if(n%2==0){
      n /= 2;
    }
    else{
      n = n*3 + 1;
    }
    if(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    }
  }
  System.out.println(cnt+1);
} main {
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  int[] a = new int[1000000];
  Arrays.fill(a,0);
  a[n]=1;
  int cnt = 1;
  for(;;){
    if(n%2==0){
      n /= 2;
    }
    else{
      n = n*3 + 1;
    }
    if(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    }
  }
  System.out.println(cnt+1);
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] a = new int[1000000]; a new int[1000000] 1000000 Arrays.fill(a,0) Arrays.fill Arrays a 0 a[n]=1 a[n] a n 1 int cnt = 1; cnt 1 for(;;){
    if(n%2==0){
      n /= 2;
    }
    else{
      n = n*3 + 1;
    }
    if(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    }
  } ; {
    if(n%2==0){
      n /= 2;
    }
    else{
      n = n*3 + 1;
    }
    if(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    }
  } {
    if(n%2==0){
      n /= 2;
    }
    else{
      n = n*3 + 1;
    }
    if(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    }
  } 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(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    } a[n] == 1 a[n] a n 1 {
      break;
    } break; {
      a[n] = 1;
      cnt++;
    } a[n] = 1 a[n] a n 1 cnt++ cnt System.out.println(cnt+1) System.out.println System.out System System.out cnt+1 cnt 1 String[] args args public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  int[] a = new int[1000000];
  Arrays.fill(a,0);
  a[n]=1;
  int cnt = 1;
  for(;;){
    if(n%2==0){
      n /= 2;
    }
    else{
      n = n*3 + 1;
    }
    if(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    }
  }
  System.out.println(cnt+1);
}} public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  int[] a = new int[1000000];
  Arrays.fill(a,0);
  a[n]=1;
  int cnt = 1;
  for(;;){
    if(n%2==0){
      n /= 2;
    }
    else{
      n = n*3 + 1;
    }
    if(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    }
  }
  System.out.println(cnt+1);
}} Main
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int n = sc.nextInt();
  int[] a = new int[1000000];
  Arrays.fill(a,0);
  a[n]=1;
  int cnt = 1;
  for(;;){
    if(n%2==0){
      n /= 2;
    }
    else{
      n = n*3 + 1;
    }
    if(a[n] == 1){
      break;
    }
    else{
      a[n] = 1;
      cnt++;
    }
  }
  System.out.println(cnt+1);
}}
      
