import std.algorithm;
import std.bigint;
import std.concurrency;
import std.container;
import std.conv;
import std.functional;
import std.format;
import std.math;
import std.meta;
import std.numeric;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;


auto solve(long s) {
    alias f = (long n) => n % 2 == 0 ? (n / 2) : (3 * n + 1);
    auto set = make!(RedBlackTree!long);

    long ans = 1;
    long a = s;

    set.insert(a);
    while (true) {
        ans++;
        a = f(a);
        if (set.removeKey(a) > 0)
            return ans;
        set.insert(a);
    }
}


void main() {
    auto input = stdin.byLine.map!split.joiner;

    long s;
    s = input.front.to!long;
    input.popFront;

    static if (is(ReturnType!solve == void))
        solve(s);
    else
        solve(s).writeln;
}
