#include <bits/stdc++.h>
using namespace std;
int main() {
    int s;
    cin >> s;
    set<int> u;
    int m = 1;
    while (u.find(s) == u.end()) {
        u.insert(s);
        s = (s&1)==0 ? s/2 : 3*s+1;
        m++;
    }
    cout << m << '\n';
    return 0;
}