import java.util.Scanner;

public class Main {

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

		String s = sc.next();
		String [] str = s.split("");
		int[] n = new int[s.length()];
		for (int i = 0; i < s.length(); i++) {
			n[i] = Integer.parseInt(str[i]);
		}
		int cnt = 0;
		for (int i = 0; i < s.length() - 1; i++) {
			if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			}
		}
		System.out.println(cnt);
	}
} 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 [] str = s.split("");
		int[] n = new int[s.length()];
		for (int i = 0; i < s.length(); i++) {
			n[i] = Integer.parseInt(str[i]);
		}
		int cnt = 0;
		for (int i = 0; i < s.length() - 1; i++) {
			if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			}
		}
		System.out.println(cnt);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		String [] str = s.split("");
		int[] n = new int[s.length()];
		for (int i = 0; i < s.length(); i++) {
			n[i] = Integer.parseInt(str[i]);
		}
		int cnt = 0;
		for (int i = 0; i < s.length() - 1; i++) {
			if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			}
		}
		System.out.println(cnt);
	} main {
		Scanner sc = new Scanner(System.in);

		String s = sc.next();
		String [] str = s.split("");
		int[] n = new int[s.length()];
		for (int i = 0; i < s.length(); i++) {
			n[i] = Integer.parseInt(str[i]);
		}
		int cnt = 0;
		for (int i = 0; i < s.length() - 1; i++) {
			if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			}
		}
		System.out.println(cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String [] str = s.split(""); str s.split("") s.split s "" int[] n = new int[s.length()]; n new int[s.length()] s.length() s.length s for (int i = 0; i < s.length(); i++) {
			n[i] = Integer.parseInt(str[i]);
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			n[i] = Integer.parseInt(str[i]);
		} {
			n[i] = Integer.parseInt(str[i]);
		} n[i] = Integer.parseInt(str[i]) n[i] n i Integer.parseInt(str[i]) Integer.parseInt Integer str[i] str i int cnt = 0; cnt 0 for (int i = 0; i < s.length() - 1; i++) {
			if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			}
		} int i = 0; int i = 0; i 0 i < s.length() - 1 i s.length() - 1 s.length() s.length s 1 i++ i++ i {
			if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			}
		} {
			if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			}
		} if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			} n[i] == n[i+1] n[i] n i n[i+1] n i+1 i 1 {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			} cnt++ cnt if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				} n[i+1] == 0 n[i+1] n i+1 i 1 0 {
					n[i+1] = 1;
				} n[i+1] = 1 n[i+1] n i+1 i 1 1 {
					n[i+1] = 0;
				} n[i+1] = 0 n[i+1] n i+1 i 1 0 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 sc = new Scanner(System.in);

		String s = sc.next();
		String [] str = s.split("");
		int[] n = new int[s.length()];
		for (int i = 0; i < s.length(); i++) {
			n[i] = Integer.parseInt(str[i]);
		}
		int cnt = 0;
		for (int i = 0; i < s.length() - 1; i++) {
			if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			}
		}
		System.out.println(cnt);
	}
} public class Main {

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

		String s = sc.next();
		String [] str = s.split("");
		int[] n = new int[s.length()];
		for (int i = 0; i < s.length(); i++) {
			n[i] = Integer.parseInt(str[i]);
		}
		int cnt = 0;
		for (int i = 0; i < s.length() - 1; i++) {
			if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			}
		}
		System.out.println(cnt);
	}
} 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 [] str = s.split("");
		int[] n = new int[s.length()];
		for (int i = 0; i < s.length(); i++) {
			n[i] = Integer.parseInt(str[i]);
		}
		int cnt = 0;
		for (int i = 0; i < s.length() - 1; i++) {
			if (n[i] == n[i+1]) {
				cnt++;
				if(n[i+1] == 0){
					n[i+1] = 1;
				}else{
					n[i+1] = 0;
				}
			}
		}
		System.out.println(cnt);
	}
}