#include<iostream>
#include<string>

std::string s;

int res;

int main(){

    std::cin>>s;

    for(int i=0;i<s.size();i++){
        if(i%2==s[i]-'0')
        res++;
    }

    res=res<s.size()-res?res:s.size()-res;

    std::cout<<res<<std::endl;

    return 0;

}