# your code goes here
def na10(dana):
pom = 0
for i in range(len(dana)):
x = int(dana[- i -1])
pom = pom + x * 2 ** i
return pom
print (na10("101010"))
print (na10("110101"))
IyB5b3VyIGNvZGUgZ29lcyBoZXJlCgoKCgoKCgoKCmRlZiBuYTEwKGRhbmEpOgoJcG9tID0gMAoJZm9yIGkgaW4gcmFuZ2UobGVuKGRhbmEpKToKCQl4ID0gaW50KGRhbmFbLSBpIC0xXSkKCQlwb20gPSBwb20gKyB4ICogMiAqKiBpCglyZXR1cm4gcG9tIAoJCQpwcmludCAobmExMCgiMTAxMDEwIikpCnByaW50IChuYTEwKCIxMTAxMDEiKSkKCgoKCg==