n = int(input()) cnt = 0 # Divide by the maximum possible power of 2 each time while n % 2 == 0: lsb = n & -n # Find the least significant bit (max power of 2 dividing n) n //= lsb cnt += 1 # If the remaining n is greater than 1, add 2 operations (multiply and add 1, then divide) if n > 1: cnt += 2 print(cnt)