#include <bits/stdc++.h>

using namespace std;

int main()
{
    char s[100010];
    cin >> s;
    char *p;
    p = s;
    double cnt = 0;
    char one = *p;
    char two;
    if(one == '1'){
        two = '0';
    }else{
        two = '1';
    }
    bool flag = true;
    while(*p){
        if(flag){
            if(*p == two){
                cnt++;
            }
        }else{
            if(*p == one)
                cnt++;
            }
        flag = !flag;
        p++;
    }
    printf("%g", cnt);

    return 0;
}
