import java.util.*;
public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int steps1 = 0;
        int steps2 = 0;
        for(int i = 0; i < s.length(); i++) {
        	if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	}
        }

    	System.out.println(Math.min(steps1, steps2));
    }
} import java.util.*; util.* java public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int steps1 = 0;
        int steps2 = 0;
        for(int i = 0; i < s.length(); i++) {
        	if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	}
        }

    	System.out.println(Math.min(steps1, steps2));
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int steps1 = 0;
        int steps2 = 0;
        for(int i = 0; i < s.length(); i++) {
        	if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	}
        }

    	System.out.println(Math.min(steps1, steps2));
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int steps1 = 0;
        int steps2 = 0;
        for(int i = 0; i < s.length(); i++) {
        	if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	}
        }

    	System.out.println(Math.min(steps1, steps2));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int steps1 = 0; steps1 0 int steps2 = 0; steps2 0 for(int i = 0; i < s.length(); i++) {
        	if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	}
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
        	if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	}
        } {
        	if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	}
        } if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	} i % 2 == 0 i % 2 i 2 0 {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++; s.charAt(i) != '1' s.charAt(i) s.charAt s i '1' steps1++ steps1 steps2++ steps2 {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	} if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++; s.charAt(i) != '1' s.charAt(i) s.charAt s i '1' steps2++ steps2 steps1++ steps1 System.out.println(Math.min(steps1, steps2)) System.out.println System.out System System.out Math.min(steps1, steps2) Math.min Math steps1 steps2 String[] args args public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int steps1 = 0;
        int steps2 = 0;
        for(int i = 0; i < s.length(); i++) {
        	if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	}
        }

    	System.out.println(Math.min(steps1, steps2));
    }
} public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int steps1 = 0;
        int steps2 = 0;
        for(int i = 0; i < s.length(); i++) {
        	if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	}
        }

    	System.out.println(Math.min(steps1, steps2));
    }
} Main
import java.util.*;
public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();

        int steps1 = 0;
        int steps2 = 0;
        for(int i = 0; i < s.length(); i++) {
        	if(i % 2 == 0) {
        		if(s.charAt(i) != '1')
        			steps1++;
        		else
        			steps2++;
        	} else {
        		if(s.charAt(i) != '1')
        			steps2++;
        		else
        			steps1++;
        	}
        }

    	System.out.println(Math.min(steps1, steps2));
    }
}