#include <bits/stdc++.h>
using namespace std;
int main(){
string str;
while(getline(cin,str)){
int ans = 0;
for(int i = str.size() - 1,j = 1;i >= 0;i --){
ans += (str[i] - '0') * (pow(2,j) - 1);
j ++;
}
cout << ans << endl;
}
return 0;
}

京公网安备 11010502036488号