x = 2**51 + 2**45 + 2**30 + 4**7 - 2**5 mas = [] while x > 0: mas += [x%16] x //= 16 print(len(set(mas)))