#include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); string S;cin>>S; long ans=0; int cnt=0; for(char c:S) { if(c=='0') { ans+=cnt/2; cnt=cnt/2*2; } else cnt++; } cout<