import java.io.*;
import java.util.*;
import static java.lang.System.in;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);
    public static void main(String[] args){
        char[] s = sc.next().toCharArray();
        int n = s.length;
        int[] black = new int[n], white = new int[n]; // black[i]: paint the i-th to be black
        // The i-th tile from the left is painted black if the i-th character of S
        // is 0, and painted white if that character is 1.
        black[0] = s[0]=='1'?1:0; white[0] = s[0]=='0'?1:0;
        for(int i=1;i<n;i++){
            if(s[i]=='0'){
                black[i] = white[i-1];
                white[i] = black[i-1]+1;
            } else{
                white[i] = black[i-1];
                black[i] = white[i-1]+1;
            }
        }
        System.out.println(Math.min(white[n-1],black[n-1]));
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz