

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] tile = sc.next().toCharArray();
		int firstpattern = 0;
		int secondpattern = 0;
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		}
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		}
		System.out.println(Integer.min(firstpattern, secondpattern));

	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] tile = sc.next().toCharArray();
		int firstpattern = 0;
		int secondpattern = 0;
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		}
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		}
		System.out.println(Integer.min(firstpattern, secondpattern));

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] tile = sc.next().toCharArray();
		int firstpattern = 0;
		int secondpattern = 0;
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		}
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		}
		System.out.println(Integer.min(firstpattern, secondpattern));

	} main {
		Scanner sc = new Scanner(System.in);
		char[] tile = sc.next().toCharArray();
		int firstpattern = 0;
		int secondpattern = 0;
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		}
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		}
		System.out.println(Integer.min(firstpattern, secondpattern));

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] tile = sc.next().toCharArray(); tile sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int firstpattern = 0; firstpattern 0 int secondpattern = 0; secondpattern 0 for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		} int i = 0; int i = 0; i 0 i < tile.length i tile.length tile tile.length i++ i++ i {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		} {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		} if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			} (i % 2 == 0) && (tile[i] == '0') (i % 2 == 0) i % 2 i 2 0 (tile[i] == '0') tile[i] tile i '0' {
				firstpattern++;
			} firstpattern++ firstpattern if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			} (i % 2 == 1) && (tile[i] == '1') (i % 2 == 1) i % 2 i 2 1 (tile[i] == '1') tile[i] tile i '1' {
				firstpattern++;
			} firstpattern++ firstpattern for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		} int i = 0; int i = 0; i 0 i < tile.length i tile.length tile tile.length i++ i++ i {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		} {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		} if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			} (i % 2 == 0) && (tile[i] == '1') (i % 2 == 0) i % 2 i 2 0 (tile[i] == '1') tile[i] tile i '1' {
				secondpattern++;
			} secondpattern++ secondpattern if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			} (i % 2 == 1) && (tile[i] == '0') (i % 2 == 1) i % 2 i 2 1 (tile[i] == '0') tile[i] tile i '0' {
				secondpattern++;
			} secondpattern++ secondpattern System.out.println(Integer.min(firstpattern, secondpattern)) System.out.println System.out System System.out Integer.min(firstpattern, secondpattern) Integer.min Integer firstpattern secondpattern String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] tile = sc.next().toCharArray();
		int firstpattern = 0;
		int secondpattern = 0;
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		}
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		}
		System.out.println(Integer.min(firstpattern, secondpattern));

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] tile = sc.next().toCharArray();
		int firstpattern = 0;
		int secondpattern = 0;
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		}
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		}
		System.out.println(Integer.min(firstpattern, secondpattern));

	}

} Main


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] tile = sc.next().toCharArray();
		int firstpattern = 0;
		int secondpattern = 0;
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '0')) {
				firstpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '1')) {
				firstpattern++;
			}
		}
		for(int i = 0; i < tile.length; i++) {
			if((i % 2 == 0) && (tile[i] == '1')) {
				secondpattern++;
			}
			if((i % 2 == 1) && (tile[i] == '0')) {
				secondpattern++;
			}
		}
		System.out.println(Integer.min(firstpattern, secondpattern));

	}

}
