import java.util.Scanner;

class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);

	String S = sc.next();
	String x[] = S.split("");

	int count = 0;
	if (x.length < 2)
	    System.out.println(0);
	else {
	    for (int i = 1; i < x.length; i++) {
		if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		}
	    }
	    System.out.println(count);
	}
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);

	String S = sc.next();
	String x[] = S.split("");

	int count = 0;
	if (x.length < 2)
	    System.out.println(0);
	else {
	    for (int i = 1; i < x.length; i++) {
		if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		}
	    }
	    System.out.println(count);
	}
    }
} Main public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);

	String S = sc.next();
	String x[] = S.split("");

	int count = 0;
	if (x.length < 2)
	    System.out.println(0);
	else {
	    for (int i = 1; i < x.length; i++) {
		if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		}
	    }
	    System.out.println(count);
	}
    } main {
	Scanner sc = new Scanner(System.in);

	String S = sc.next();
	String x[] = S.split("");

	int count = 0;
	if (x.length < 2)
	    System.out.println(0);
	else {
	    for (int i = 1; i < x.length; i++) {
		if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		}
	    }
	    System.out.println(count);
	}
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc String x[] = S.split(""); x S.split("") S.split S "" int count = 0; count 0 if (x.length < 2)
	    System.out.println(0);
	else {
	    for (int i = 1; i < x.length; i++) {
		if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		}
	    }
	    System.out.println(count);
	} x.length < 2 x.length x x.length 2 System.out.println(0) System.out.println System.out System System.out 0 {
	    for (int i = 1; i < x.length; i++) {
		if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		}
	    }
	    System.out.println(count);
	} for (int i = 1; i < x.length; i++) {
		if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		}
	    } int i = 1; int i = 1; i 1 i < x.length i x.length x x.length i++ i++ i {
		if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		}
	    } {
		if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		}
	    } if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		} x[i - 1].equals(x[i]) x[i - 1].equals x[i - 1] x i - 1 i 1 x[i] x i {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		} if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0"; x[i].equals("0") x[i].equals x[i] x i "0" x[i] = "1" x[i] x i "1" if (x[i].equals("1"))
			x[i] = "0"; x[i].equals("1") x[i].equals x[i] x i "1" x[i] = "0" x[i] x i "0" count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);

	String S = sc.next();
	String x[] = S.split("");

	int count = 0;
	if (x.length < 2)
	    System.out.println(0);
	else {
	    for (int i = 1; i < x.length; i++) {
		if (x[i - 1].equals(x[i])) {
		    if (x[i].equals("0"))
			x[i] = "1";
		    else if (x[i].equals("1"))
			x[i] = "0";
		    count++;
		}
	    }
	    System.out.println(count);
	}
    }
}