import java.util.Scanner;

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

		String s = sc.next();
		String[] ss = s.split("");
		int count = 0;
		for(int i=1; i<ss.length; i++) {
			if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			}
		}
		System.out.println(count);
	}

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

		String s = sc.next();
		String[] ss = s.split("");
		int count = 0;
		for(int i=1; i<ss.length; i++) {
			if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			}
		}
		System.out.println(count);
	}

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

		String s = sc.next();
		String[] ss = s.split("");
		int count = 0;
		for(int i=1; i<ss.length; i++) {
			if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			}
		}
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		String[] ss = s.split("");
		int count = 0;
		for(int i=1; i<ss.length; i++) {
			if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			}
		}
		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[] ss = s.split(""); ss s.split("") s.split s "" int count = 0; count 0 for(int i=1; i<ss.length; i++) {
			if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			}
		} int i=1; int i=1; i 1 i<ss.length i ss.length ss ss.length i++ i++ i {
			if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			}
		} {
			if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			}
		} if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			} ss[i].equals(ss[i-1]) ss[i].equals ss[i] ss i ss[i-1] ss i-1 i 1 {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			} count++ count if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0"; ss[i].equals("0") ss[i].equals ss[i] ss i "0" ss[i] = "1" ss[i] ss i "1" ss[i]  = "0" ss[i] ss i "0" System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		String[] ss = s.split("");
		int count = 0;
		for(int i=1; i<ss.length; i++) {
			if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			}
		}
		System.out.println(count);
	}

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

		String s = sc.next();
		String[] ss = s.split("");
		int count = 0;
		for(int i=1; i<ss.length; i++) {
			if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			}
		}
		System.out.println(count);
	}

} Main
import java.util.Scanner;

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

		String s = sc.next();
		String[] ss = s.split("");
		int count = 0;
		for(int i=1; i<ss.length; i++) {
			if(ss[i].equals(ss[i-1])) {
				count++;
				if(ss[i].equals("0"))
					ss[i] = "1";
				else
					ss[i]  = "0";

			}
		}
		System.out.println(count);
	}

}
