#include <iostream>
using namespace std;
long long func(long long a) {
    if (a % 2 == 0)
        return a / 2;
    else
        return 3 * a + 1;
}
int main() {
    long long i, s, p, q;
    int a[1000001] = {0};
    cin >> s;
    q = s;
    a[s]++;
    for (i = 2; i <= 1000000; i++) {
        long long p = func(q);
        a[p]++;
        if (a[p] == 2) {
            cout << i << endl;
            return 0;
        }
        q = p;
    }
    return 0;
}