void main(){ import std.stdio, std.string, std.conv, std.algorithm; long n; rd(n); int c=0; while(n>1){ if(n&1) n++; else n/=2; c++; } writeln(c); } void rd(T...)(ref T x){ import std.stdio, std.string, std.conv; auto l=readln.split; assert(l.length==x.length); foreach(i, ref e; x){ e=l[i].to!(typeof(e)); } } void wr(T...)(T x){ import std.stdio; foreach(e; x) write(e, " "); writeln(); }