#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define repi(i, a, b) for (long long i = (long long)(a); i < (long long)(b); i++)
#define drep(i, n) for (long long i = n - 1; i > 0; i--)
#define pb push_back
#define all(x) (x).begin(), (x).end()

using namespace std;

int main()
{
    int a;

    scanf("%d", &a);

    int cnt = 1;
    int buff[10000002];
    while ((a != 4&&a != 1)&&a != 2)
    {
        if (a % 2 == 0)
        {
            buff[cnt] = a;
            a /= 2;
        }
        else
        {
            buff[cnt] = a;
            a = 3 * a + 1;
        }
        cnt++;
        for (int i = 1; i < cnt; i++)
        {
            if (a == buff[i])
            {
                cout << cnt << endl;
                return 0;
            }
        }
        }
    cout << cnt + 3 << endl;

    return 0;

    /* //ABC 098 B
    int n;
    cin >> n;
    string s;
    cin >> s;
    bool left = false, right = false;
    int cnt = 0, ans_max = -1;
    for (int i = 0; i < n; i++)
    {
        for (int j = 'a'; j <= 'z'; j++)
        {
            for (int k = 0; k < i; k++)
            {
                if (s[k] == j)
                {
                    left = true;
                }
            }
            for (int k = n - 1; k >= i; k--)
            {
                if (s[k] == j)
                {
                    right = true;
                }
            }
            if (left && right)
            {
                cnt++;
            }
            left = false;
            right = false;
        }
        ans_max = max(cnt, ans_max);
        cnt = 0;
    }
    cout << ans_max << endl;
    return 0;
    */
    /* //ABC ??? B
    int a, b, n;
    cin >> a >> b >> n;
    bool print_judge[b - a + 2] = {false};
    for (int i = 0; i < n; i++)
    {
        if (i == b - a + 1)
        {
            break;
        }
        print_judge[i] = true;
    }
    for (int i = b - a ; i > b - a - n; i--)
    {
        if (i < 0)
        {
            break;
        }
        print_judge[i] = true;
    }
    int cnt = 0;
    for (int i = 0; i <= b - a; i++)
    {
        if (print_judge[i] == true)
        {
            cout << a + i << " ";
        }
    }
    cout << "\n";

    return 0;
    */

    //ABC 097 B ??
    /*
    int n;
    cin >> n;
    bool flag_overflow = true;
    int i = 1;
    while(flag_overflow)
    {
        if(i*i > n)
        {   
            cout << "\n";
            flag_overflow = false; //   冗長
            return 0;
        }
        cout << i*i <<" ";
        i++;
    }
    */

    //ABC 092 b
    /*
    int n,d,x,a[101],eat,ans = 0;
    cin >> n >> d >> x ;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        eat = (d-1)/a[i];   //一日目を除いて食べた分の計算
        ans += eat+1;   //一日目の一個を加えて加算
    }
    ans += x;   //残りの個数を加算
    cout << ans << endl;
    return 0;
    */

    // ABC 091 B
    /*int n
    cin >> n ;
    string s[101];
    int s_collection[101] = {0};
    for(int i = 0; i<n;i++){
        cin >> s[i];
    }
    cin >> m;
    string t[101];
    for(int i = 0; i<m ;i++){
        cin >> t[i];
    }
    */

    //ABC 090 B
    /*
    int a, b;
    cin >> a >> b;
    int a_1, a_10, a_100, a_1000, a_10000;
    int ans = 0;
    while (a != b)
    {
        a_1 = a % 10, a_10 = (a / 10) % 10, a_1000 = (a / 1000) % 10, a_10000 = (a / 10000);
        if (a_1 == a_10000&&a_10 == a_1000)
        {
            ans++;
        }
        a++;
    }
    cout << ans << endl;
    return 0;
    */

    // ABC 089 B
    /*
    int n;
    cin >> n;
    char s;
    for (int i = 0; i < n; i++)
    {
        cin >> s;

        if (s == 'Y')
        {
            cout << "Four\n";
            return 0;
        }
    }
    cout << "Three\n";
    return 0;
    */
    // ABC 088 B
    /*
    int n;
    cin >> n;
    int a[101];
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = n - 1; i < j; j--)
        {
            if (a[j] > a[j - 1])
            {
                int tmp = a[j];
                a[j] = a[j - 1];
                a[j - 1] = tmp;
            }
        }
    }
    int Alice = 0, BOB = 0;
    for (int i = 0; i < n; i++)
    {
        if (i % 2 == 0)
        {
            Alice += a[i];
        }
        else
        {
            BOB += a[i];
        }
    }
    cout << Alice - BOB << endl;
    return 0;
    */
    /*
    char c[6];
    for (int i = 0; i < 6; i++)
    {
        cin >> c[i];
    }
    if (c[0] == c[5] && c[1] == c[4] && c[2] == c[3])
    {
        cout << "YES\n";
        return 0;
    }
    else
    {
        cout << "NO\n";
        return 0;
    }*/
}

Measured memory_bytes: 256