import java.util.Scanner;
public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		String tile = scan.next();
		String[] array = new String[tile.length()];
		int count = 0;

		for(int i=0;i<tile.length();i++) {
			array[i] = tile.substring(i,i+1);
		}

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

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

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

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		String tile = scan.next();
		String[] array = new String[tile.length()];
		int count = 0;

		for(int i=0;i<tile.length();i++) {
			array[i] = tile.substring(i,i+1);
		}

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

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

} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		String tile = scan.next();
		String[] array = new String[tile.length()];
		int count = 0;

		for(int i=0;i<tile.length();i++) {
			array[i] = tile.substring(i,i+1);
		}

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

		System.out.println(count);
		scan.close();
	} main {

		Scanner scan = new Scanner(System.in);

		String tile = scan.next();
		String[] array = new String[tile.length()];
		int count = 0;

		for(int i=0;i<tile.length();i++) {
			array[i] = tile.substring(i,i+1);
		}

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

		System.out.println(count);
		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String tile = scan.next(); tile scan.next() scan.next scan String[] array = new String[tile.length()]; array new String[tile.length()] tile.length() tile.length tile int count = 0; count 0 for(int i=0;i<tile.length();i++) {
			array[i] = tile.substring(i,i+1);
		} int i=0; int i=0; i 0 i<tile.length() i tile.length() tile.length tile i++ i++ i {
			array[i] = tile.substring(i,i+1);
		} {
			array[i] = tile.substring(i,i+1);
		} array[i] = tile.substring(i,i+1) array[i] array i tile.substring(i,i+1) tile.substring tile i i+1 i 1 for(int i=0;i<tile.length()-1;i++) {
			if(array[i].equals("0") && array[i+1].equals("0")) {
				array[i+1] = "1";
				count++;
			}else if(array[i].equals("1") && array[i+1].equals("1")) {
				array[i+1] = "0";
				count++;
			}
		} int i=0; int i=0; i 0 i<tile.length()-1 i tile.length()-1 tile.length() tile.length tile 1 i++ i++ i {
			if(array[i].equals("0") && array[i+1].equals("0")) {
				array[i+1] = "1";
				count++;
			}else if(array[i].equals("1") && array[i+1].equals("1")) {
				array[i+1] = "0";
				count++;
			}
		} {
			if(array[i].equals("0") && array[i+1].equals("0")) {
				array[i+1] = "1";
				count++;
			}else if(array[i].equals("1") && array[i+1].equals("1")) {
				array[i+1] = "0";
				count++;
			}
		} if(array[i].equals("0") && array[i+1].equals("0")) {
				array[i+1] = "1";
				count++;
			}else if(array[i].equals("1") && array[i+1].equals("1")) {
				array[i+1] = "0";
				count++;
			} array[i].equals("0") && array[i+1].equals("0") array[i].equals("0") array[i].equals array[i] array i "0" array[i+1].equals("0") array[i+1].equals array[i+1] array i+1 i 1 "0" {
				array[i+1] = "1";
				count++;
			} array[i+1] = "1" array[i+1] array i+1 i 1 "1" count++ count if(array[i].equals("1") && array[i+1].equals("1")) {
				array[i+1] = "0";
				count++;
			} array[i].equals("1") && array[i+1].equals("1") array[i].equals("1") array[i].equals array[i] array i "1" array[i+1].equals("1") array[i+1].equals array[i+1] array i+1 i 1 "1" {
				array[i+1] = "0";
				count++;
			} array[i+1] = "0" array[i+1] array i+1 i 1 "0" count++ count System.out.println(count) System.out.println System.out System System.out count scan.close() scan.close scan String[] args args public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		String tile = scan.next();
		String[] array = new String[tile.length()];
		int count = 0;

		for(int i=0;i<tile.length();i++) {
			array[i] = tile.substring(i,i+1);
		}

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

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

} public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		String tile = scan.next();
		String[] array = new String[tile.length()];
		int count = 0;

		for(int i=0;i<tile.length();i++) {
			array[i] = tile.substring(i,i+1);
		}

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

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

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

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		String tile = scan.next();
		String[] array = new String[tile.length()];
		int count = 0;

		for(int i=0;i<tile.length();i++) {
			array[i] = tile.substring(i,i+1);
		}

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

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

}
