typedef long long ll; #include using namespace std; int main() { string s; std::cin >> s; ll n = s.length(); vector cnt; ll ren0 = 0; ll ren1 = 0; for (int i = 0; i < n; i++) { if(s[i]=='1'){ if(ren0==0){ ren1++; }else{ cnt.push_back(ren0); ren0=0; ren1=1; } }else{ if(ren1==0){ ren0++; }else{ cnt.push_back(ren1); ren1=0; ren0=1; } } } ll ans = 0; cnt.push_back(max(ren0,ren1)); for (int i = 0; i < cnt.size(); i++) { if(i%2==0){ if(cnt[i]==1){ ans++; }else{ // 押し付けられるとき if(i