input = require('fs').readFileSync('/dev/stdin', 'utf8')
s = input.split('\n').shift() * 1
o = []
i = 1
while (o[s] === undefined) {
    o[s] = 1
    if (s%2) {
        s = 3 * s + 1 
    } else {
        s = s / 2
    }
    i++
    if (o[s] == 1) {
        break;
    }
}
console.log(i)