import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    auto s = readln.chomp.to!ulong;
    bool[1000000] memo;
    foreach (i; 0..1000000) {
        memo[s] = true;
        auto a = s & 1 ? (3*s+1) : (s/2);
        if (memo[a]) {
            writeln(i+2);
            return;
        }
        s = a;
    }
}

