using System.Console;
public class Test
{
public static Main() : void
{
def f = ReadLine();
mutable x = 0;
mutable y = 1;
for(mutable i = 99; i >= 0; i--){
if(f[i] == '1'){
x = x+y;
}
else{
x = x;
}
y *= 2;
}
WriteLine(x);
}
}
dXNpbmcgU3lzdGVtLkNvbnNvbGU7CnB1YmxpYyBjbGFzcyBUZXN0CnsKCXB1YmxpYyBzdGF0aWMgTWFpbigpIDogdm9pZAoJewoJCWRlZiBmID0gUmVhZExpbmUoKTsKCQltdXRhYmxlIHggPSAwOwoJCW11dGFibGUgeSA9IDE7CgkJZm9yKG11dGFibGUgaSA9IDk5OyBpID49IDA7IGktLSl7CgkJCWlmKGZbaV0gPT0gJzEnKXsKCQkJCXggPSB4K3k7CgkJCX0KCQkJZWxzZXsKCQkJCXggPSB4OwoJCQl9CgkJCXkgKj0gMjsKCQl9CgkJV3JpdGVMaW5lKHgpOwoJfQp9