// Original C++ solution (slower):
#include <iostream> // cout, endl, cin

#include <string> // string, to_string, stoi

#include <vector> // vector

#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound

#include <utility> // pair, make_pair

#include <tuple> // tuple, make_tuple

#include <cstdint> // int64_t, int*_t

#include <cstdio> // printf

#include <map> // map

#include <queue> // queue, priority_queue

#include <set> // set

#include <stack> // stack

#include <deque> // deque

#include <unordered_map> // unordered_map

#include <unordered_set> // unordered_set

#include <bitset> // bitset



#include <math.h>

#include <stdlib.h>





#define rep(i,n) for (int i = 0; i < (n); ++i)

using namespace std;

typedef long long ll;



template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true; } return false; }

template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true; } return false; }



//INT_MAX	2,147,483,647 = 2*1.0e9



int calc(int a){

  if(a%2 == 0) return a/2;

  else return 3 * a + 1;

}



int main(){

  int s;

  cin >> s;



  vector<int> a(1000010,-1);

  a[0] = s;



  int ans = -1;

  for(int i = 1; i < 1000000; i++){

    a[i] = calc(a[i-1]);

    for(int j = 0;  j < i; j++){

      if(a[i] == a[j]){

        cout << i+1 << endl;

        return 0;

      }

    }

  }

  

  return 0;

}


// Optimized solution to the same problem (faster):
#include <iostream> // cout, endl, cin

#include <string> // string, to_string, stoi

#include <vector> // vector

#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound

#include <utility> // pair, make_pair

#include <tuple> // tuple, make_tuple

#include <cstdint> // int64_t, int*_t

#include <cstdio> // printf

#include <map> // map

#include <queue> // queue, priority_queue

#include <set> // set

#include <stack> // stack

#include <deque> // deque

#include <unordered_map> // unordered_map

#include <unordered_set> // unordered_set

#include <bitset> // bitset



#include <math.h>

#include <stdlib.h>





#define rep(i,n) for (int i = 0; i < (n); ++i)

using namespace std;

typedef long long ll;



template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true; } return false; }

template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true; } return false; }



//INT_MAX	2,147,483,647 = 2*1.0e9



int main(){

  int s;

  cin >> s;



  set<int> st;



  while(st.count(s) == 0){

    st.insert(s);

    if(s%2 == 0) s = s/2;

    else s = 3*s+1;

  }



  cout << st.size() + 1 << endl;

  

  return 0;

}


// Fastest known solution for this problem:
#include <iostream> 



int main()

{

    int s;

    std::cin >> s;

    int list[1000000];

    int index = 0;

    int a_i;

    int a_pre = s;

    list[0] = s;

    index = index + 1;

    bool search_flag = false;

    while( true){

        if ( a_pre % 2 == 0){

            a_i = a_pre / 2;

        } else {

            a_i = 3 * a_pre + 1;

        }

        list[index] = a_i;

        index = index + 1;

        for ( int i = 0; i< index-1; ++ i ){

            if ( list[i] == a_i) {

                search_flag = true;

                break;

            }

        }

        if (search_flag==true){

            break;

        } 

        a_pre = a_i;



    }

    std::cout << index << std::endl;

    return 0;

}