
#include <iostream>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#define REP(i,n) for(int(i)=(0);(i)<(n);(i)++)

using namespace std;

int main(){
  string S;
  cin >> S;
  int siz = S.size();
  int wb,bw;
  wb = 0;
  bw = 0;
  //wbwbwbwb......
  REP(i,siz){
    if((i%2==0&&S[i]=='0')||(i%2!=0&&S[i]=='1')) wb++;
    if((i%2==0&&S[i]=='1')||(i%2!=0&&S[i]=='0')) bw++;
    }
  cout << min(wb,bw) << '\n';
}
