CodeLab Academy 📞 9936 6696
← List Python · Level 9: Functions and dicts Code · 90 points ← #850 #852 →

#851. Digit sum in base 2

You get n. Write n in base 2 and find the sum of its digits with a function `digit_sum(n, base)`. ### Input One integer n (0 ≤ n ≤ 10⁹). ### Output A number.

Examples

Input
911088603
Output
18
Input
762808419
Output
16

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!