#include<bits/stdc++.h>

int main(){
    using namespace std;
    string s;
    cin >> s;

    auto N = s.size();
    unsigned long ans{0};
    for(unsigned long i = 0; i < N; ++i)ans += (i ^ s[i]) & 1;
    cout << min(ans, N - ans) << endl;

    return 0;
}