fork download
  1. n=int(input())
  2. c=0
  3. while(n!=1):
  4. if n%2==0:
  5. n=n/2
  6. else:
  7. n=n-1
  8. c+=1
  9. print(c)
Success #stdin #stdout 0.03s 9068KB
stdin
4
stdout
2