import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    String s = scan.next();
	    scan.close();

	    int arr[]=new int[s.length()];
	    for(int i=0;i<s.length();i++) {
	    	arr[i]=Character.getNumericValue(s.charAt(i));
	    }
	    int cnt=0;
	    for(int i=1;i<s.length();i++) {
	    	if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	}
	    }

	    System.out.println(cnt);

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    String s = scan.next();
	    scan.close();

	    int arr[]=new int[s.length()];
	    for(int i=0;i<s.length();i++) {
	    	arr[i]=Character.getNumericValue(s.charAt(i));
	    }
	    int cnt=0;
	    for(int i=1;i<s.length();i++) {
	    	if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	}
	    }

	    System.out.println(cnt);

	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    String s = scan.next();
	    scan.close();

	    int arr[]=new int[s.length()];
	    for(int i=0;i<s.length();i++) {
	    	arr[i]=Character.getNumericValue(s.charAt(i));
	    }
	    int cnt=0;
	    for(int i=1;i<s.length();i++) {
	    	if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	}
	    }

	    System.out.println(cnt);

	} main {
		Scanner scan = new Scanner(System.in);
	    String s = scan.next();
	    scan.close();

	    int arr[]=new int[s.length()];
	    for(int i=0;i<s.length();i++) {
	    	arr[i]=Character.getNumericValue(s.charAt(i));
	    }
	    int cnt=0;
	    for(int i=1;i<s.length();i++) {
	    	if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	}
	    }

	    System.out.println(cnt);

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan scan.close() scan.close scan int arr[]=new int[s.length()]; arr new int[s.length()] s.length() s.length s for(int i=0;i<s.length();i++) {
	    	arr[i]=Character.getNumericValue(s.charAt(i));
	    } int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
	    	arr[i]=Character.getNumericValue(s.charAt(i));
	    } {
	    	arr[i]=Character.getNumericValue(s.charAt(i));
	    } arr[i]=Character.getNumericValue(s.charAt(i)) arr[i] arr i Character.getNumericValue(s.charAt(i)) Character.getNumericValue Character s.charAt(i) s.charAt s i int cnt=0; cnt 0 for(int i=1;i<s.length();i++) {
	    	if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	}
	    } int i=1; int i=1; i 1 i<s.length() i s.length() s.length s i++ i++ i {
	    	if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	}
	    } {
	    	if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	}
	    } if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	} arr[i-1]==arr[i] arr[i-1] arr i-1 i 1 arr[i] arr i {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	} arr[i] = (arr[i]+1)%2 arr[i] arr i (arr[i]+1)%2 (arr[i]+1) arr[i] arr i 1 2 cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    String s = scan.next();
	    scan.close();

	    int arr[]=new int[s.length()];
	    for(int i=0;i<s.length();i++) {
	    	arr[i]=Character.getNumericValue(s.charAt(i));
	    }
	    int cnt=0;
	    for(int i=1;i<s.length();i++) {
	    	if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	}
	    }

	    System.out.println(cnt);

	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    String s = scan.next();
	    scan.close();

	    int arr[]=new int[s.length()];
	    for(int i=0;i<s.length();i++) {
	    	arr[i]=Character.getNumericValue(s.charAt(i));
	    }
	    int cnt=0;
	    for(int i=1;i<s.length();i++) {
	    	if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	}
	    }

	    System.out.println(cnt);

	}

} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    String s = scan.next();
	    scan.close();

	    int arr[]=new int[s.length()];
	    for(int i=0;i<s.length();i++) {
	    	arr[i]=Character.getNumericValue(s.charAt(i));
	    }
	    int cnt=0;
	    for(int i=1;i<s.length();i++) {
	    	if(arr[i-1]==arr[i]) {
	    		arr[i] = (arr[i]+1)%2;
	    		cnt++;
	    	}
	    }

	    System.out.println(cnt);

	}

}