#include <bits/stdc++.h>
using namespace std;

#define f(i,a,b) for (int i = a; i < b; i++)

int main() {
string s; cin>>s;
int n = s.length();
int a = 0, b = 0;
f(i,0,n) {
if (s[i]-'0' == (i&1)) a++;
}
cout << min(a,n-a) << endl;
return 0;
}