#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;cin>>S;int A=0,N=S.size();
  for(int i=0;i<N;i++){
    if((i%2==0&&S.at(i)=='0')||(i%2==1&&S.at(i)=='1'))A++;
  }
  
  cout<<min(A,N-A)<<endl;
}