#include #include #include #include #include #include #include #include #include #include #define mkp make_pair #define mkt make_tuple #define rep(i,n) for(int i = 0; i < (n); ++i) using namespace std; typedef long long ll; const ll MOD=1e9+7; int N; string S; int main(){ cin>>S; N=S.size(); string T=S; reverse(T.begin(),T.end()); int ans=0; int one=0; for(int i=0;i1){ T[i+1]='1'; } one=0; } }else{ if(T[i]=='1'){ if(one>1) ans+=2; else ans++; } } } cout<