import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.next();
        int min1=0;
        int min2=0;
        for (int i=0 ; i<str.length();i++){
        	if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	}
        }
        System.out.println(Math.min(min1,min2));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.next();
        int min1=0;
        int min2=0;
        for (int i=0 ; i<str.length();i++){
        	if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	}
        }
        System.out.println(Math.min(min1,min2));
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.next();
        int min1=0;
        int min2=0;
        for (int i=0 ; i<str.length();i++){
        	if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	}
        }
        System.out.println(Math.min(min1,min2));
    } main {
        Scanner scan = new Scanner(System.in);
        String str = scan.next();
        int min1=0;
        int min2=0;
        for (int i=0 ; i<str.length();i++){
        	if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	}
        }
        System.out.println(Math.min(min1,min2));
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String str = scan.next(); str scan.next() scan.next scan int min1=0; min1 0 int min2=0; min2 0 for (int i=0 ; i<str.length();i++){
        	if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	}
        } int i=0 ; int i=0 ; i 0 i<str.length() i str.length() str.length str i++ i++ i {
        	if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	}
        } {
        	if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	}
        } if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	} i%2 ==Character.getNumericValue(str.charAt(i)) i%2 i 2 Character.getNumericValue(str.charAt(i)) Character.getNumericValue Character str.charAt(i) str.charAt str i {
        		min1 +=1;
        	} min1 +=1 min1 1 {
        		min2 +=1;
        	} min2 +=1 min2 1 System.out.println(Math.min(min1,min2)) System.out.println System.out System System.out Math.min(min1,min2) Math.min Math min1 min2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.next();
        int min1=0;
        int min2=0;
        for (int i=0 ; i<str.length();i++){
        	if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	}
        }
        System.out.println(Math.min(min1,min2));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.next();
        int min1=0;
        int min2=0;
        for (int i=0 ; i<str.length();i++){
        	if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	}
        }
        System.out.println(Math.min(min1,min2));
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.next();
        int min1=0;
        int min2=0;
        for (int i=0 ; i<str.length();i++){
        	if(i%2 ==Character.getNumericValue(str.charAt(i))){
        		min1 +=1;
        	}else{
        		min2 +=1;
        	}
        }
        System.out.println(Math.min(min1,min2));
    }
}