n=int(input())c=0while(n!=1): if n%2==0: n=n/2 else: n=n-1 c+=1print(c)
4
2
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!