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

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

int f(int n) {
    if (n % 2 == 0) return n / 2;
    return 3 * n + 1;
}

void main() {
    int s = readint;

    int[int] d;
    d[s] = 1;
    int prev = s;
    for (int i = 2; ; i++) {
        int x = f(prev);
        if (x in d) {
            writeln(i);
            break;
        }
        else {
            d[x] = i;
            prev = x;
        }
    }
}
