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"))
print (na10 ("10101010101001010100101010101"))
print (na10 ("101010100001111111001010101010101010101010101010101010011111111111"))
print (na10 ("111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"))
ZGVmIG5hMTAoZGFuYSk6Cglwb20gPSAwCglmb3IgaSBpbiByYW5nZShsZW4oZGFuYSkpOgoJCXggPSBpbnQoZGFuYVstIGkgLSAxIF0pCgkJcG9tID0gcG9tICsgeCAqIDIgKiogaQoJcmV0dXJuIHBvbQpwcmludCAobmExMCAoIjEwMTAxMCIpKQpwcmludCAobmExMCAoIjExMDEwMSIpKQpwcmludCAobmExMCAoIjEwMTAxMDEwMTAxMDAxMDEwMTAwMTAxMDEwMTAxIikpCnByaW50IChuYTEwICgiMTAxMDEwMTAwMDAxMTExMTExMDAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMTAxMDEwMDExMTExMTExMTExIikpCnByaW50IChuYTEwICgiMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExIikpCg==