"""
Python 程式練習:
寫一程式讀入一整數(python用二的補數系統表示此整數),
計算此整數在該表示法下1的個數,
若是奇數個則列印odd parity 否則列印 even parity。
(e.g 輸入 5 (bit pattern : 0...0101) 輸出 even parity)
(required skills: while loop; (bit level 邏輯運算 & (AND), >> (shift right)。
"""
number=int(input())
print("bit pattern:",bin(number) ) #10進位轉為2進位
countOne=0 #計算1的個數
while number:
countOne+=(number&1)#將number的值做位元運算
#若個位數位元為1
#則countOne+1
#否則countOne+0
number= number>>1 #number右移一位元
print(countOne)
IiIiClB5dGhvbiDnqIvlvI/nt7Tnv5I6IArlr6vkuIDnqIvlvI/oroDlhaXkuIDmlbTmlbgocHl0aG9u55So5LqM55qE6KOc5pW457O757Wx6KGo56S65q2k5pW05pW4Ke+8jAroqIjnrpfmraTmlbTmlbjlnKjoqbLooajnpLrms5XkuIsx55qE5YCL5pW477yMCuiLpeaYr+Wlh+aVuOWAi+WJh+WIl+WNsG9kZCBwYXJpdHkg5ZCm5YmH5YiX5Y2wIGV2ZW4gcGFyaXR544CCCihlLmcg6Ly45YWlIDUgKGJpdCBwYXR0ZXJuIDogMC4uLjAxMDEpIOi8uOWHuiBldmVuIHBhcml0eSkgCihyZXF1aXJlZCBza2lsbHM6IHdoaWxlIGxvb3A7IChiaXQgbGV2ZWwg6YKP6Lyv6YGL566XICYgKEFORCksID4+IChzaGlmdCByaWdodCnjgIIKIiIiCgoKbnVtYmVyPWludChpbnB1dCgpKQpwcmludCgiYml0IHBhdHRlcm46IixiaW4obnVtYmVyKSApICMxMOmAsuS9jei9ieeCujLpgLLkvY0KCgpjb3VudE9uZT0wICAj6KiI566XMeeahOWAi+aVuAp3aGlsZSBudW1iZXI6CiAgICBjb3VudE9uZSs9KG51bWJlciYxKSPlsIdudW1iZXLnmoTlgLzlgZrkvY3lhYPpgYvnrpcKICAgICAgICAgICAgICAgICAgICAgICAgI+iLpeWAi+S9jeaVuOS9jeWFg+eCujEKICAgICAgICAgICAgICAgICAgICAgICAgI+WJh2NvdW50T25lKzEKICAgICAgICAgICAgICAgICAgICAgICAgI+WQpuWJh2NvdW50T25lKzAKICAgICAgICAgICAgICAgICAgICAgICAgCiAgICBudW1iZXI9IG51bWJlcj4+MSAgICNudW1iZXLlj7Pnp7vkuIDkvY3lhYMKCnByaW50KGNvdW50T25lKQoKICAgIAogICAg