
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		int n = s.length();

		boolean[] list0 = new boolean[n];
		boolean[] list1 = new boolean[n];
		int x  = 0;
		int xx = 1;

		for(int i = 1; i <= n; i++) {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		}

		int ans0 = 0;
		int ans1 = 0;

		for(int i = 0; i < n; i++) {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		}

		System.out.println(Math.min(n - ans0, n - ans1));



	}

	public static boolean XOR(int x, int y) {

		if(x == y) {
			return true;
		}

		return false;
	}

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

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		int n = s.length();

		boolean[] list0 = new boolean[n];
		boolean[] list1 = new boolean[n];
		int x  = 0;
		int xx = 1;

		for(int i = 1; i <= n; i++) {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		}

		int ans0 = 0;
		int ans1 = 0;

		for(int i = 0; i < n; i++) {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		}

		System.out.println(Math.min(n - ans0, n - ans1));



	}

	public static boolean XOR(int x, int y) {

		if(x == y) {
			return true;
		}

		return false;
	}

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

		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		int n = s.length();

		boolean[] list0 = new boolean[n];
		boolean[] list1 = new boolean[n];
		int x  = 0;
		int xx = 1;

		for(int i = 1; i <= n; i++) {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		}

		int ans0 = 0;
		int ans1 = 0;

		for(int i = 0; i < n; i++) {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		}

		System.out.println(Math.min(n - ans0, n - ans1));



	} main {

		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		int n = s.length();

		boolean[] list0 = new boolean[n];
		boolean[] list1 = new boolean[n];
		int x  = 0;
		int xx = 1;

		for(int i = 1; i <= n; i++) {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		}

		int ans0 = 0;
		int ans1 = 0;

		for(int i = 0; i < n; i++) {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		}

		System.out.println(Math.min(n - ans0, n - ans1));



	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.nextLine(); s scan.nextLine() scan.nextLine scan int n = s.length(); n s.length() s.length s boolean[] list0 = new boolean[n]; list0 new boolean[n] n boolean[] list1 = new boolean[n]; list1 new boolean[n] n int x  = 0; x 0 int xx = 1; xx 1 for(int i = 1; i <= n; i++) {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		} {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		} int y = (int) s.charAt(i - 1) - 48; y (int) s.charAt(i - 1) - 48 (int) s.charAt(i - 1) s.charAt s i - 1 i 1 48 if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			} i % 2 != 0 i % 2 i 2 0 {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			} list0[i - 1] = XOR(x, y) list0[i - 1] list0 i - 1 i 1 XOR(x, y) XOR x y list1[i - 1] = XOR(xx, y) list1[i - 1] list1 i - 1 i 1 XOR(xx, y) XOR xx y {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			} list0[i - 1] = XOR(xx, y) list0[i - 1] list0 i - 1 i 1 XOR(xx, y) XOR xx y list1[i - 1] = XOR(x, y) list1[i - 1] list1 i - 1 i 1 XOR(x, y) XOR x y int ans0 = 0; ans0 0 int ans1 = 0; ans1 0 for(int i = 0; i < n; i++) {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		} {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		} if(list0[i]) {
				ans0++;
			} list0[i] list0 i {
				ans0++;
			} ans0++ ans0 if(list1[i]) {
				ans1++;
			} list1[i] list1 i {
				ans1++;
			} ans1++ ans1 System.out.println(Math.min(n - ans0, n - ans1)) System.out.println System.out System System.out Math.min(n - ans0, n - ans1) Math.min Math n - ans0 n ans0 n - ans1 n ans1 String[] args args public static boolean XOR(int x, int y) {

		if(x == y) {
			return true;
		}

		return false;
	} XOR {

		if(x == y) {
			return true;
		}

		return false;
	} if(x == y) {
			return true;
		} x == y x y {
			return true;
		} return true; true return false; false int x x int y y public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		int n = s.length();

		boolean[] list0 = new boolean[n];
		boolean[] list1 = new boolean[n];
		int x  = 0;
		int xx = 1;

		for(int i = 1; i <= n; i++) {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		}

		int ans0 = 0;
		int ans1 = 0;

		for(int i = 0; i < n; i++) {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		}

		System.out.println(Math.min(n - ans0, n - ans1));



	}

	public static boolean XOR(int x, int y) {

		if(x == y) {
			return true;
		}

		return false;
	}

} public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		int n = s.length();

		boolean[] list0 = new boolean[n];
		boolean[] list1 = new boolean[n];
		int x  = 0;
		int xx = 1;

		for(int i = 1; i <= n; i++) {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		}

		int ans0 = 0;
		int ans1 = 0;

		for(int i = 0; i < n; i++) {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		}

		System.out.println(Math.min(n - ans0, n - ans1));



	}

	public static boolean XOR(int x, int y) {

		if(x == y) {
			return true;
		}

		return false;
	}

} Main

import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		int n = s.length();

		boolean[] list0 = new boolean[n];
		boolean[] list1 = new boolean[n];
		int x  = 0;
		int xx = 1;

		for(int i = 1; i <= n; i++) {

			int y = (int) s.charAt(i - 1) - 48;

			if(i % 2 != 0) {

				list0[i - 1] = XOR(x, y);
				list1[i - 1] = XOR(xx, y);

			}else {

				list0[i - 1] = XOR(xx, y);
				list1[i - 1] = XOR(x, y);
			}
		}

		int ans0 = 0;
		int ans1 = 0;

		for(int i = 0; i < n; i++) {

			if(list0[i]) {
				ans0++;
			}
			if(list1[i]) {
				ans1++;
			}

		}

		System.out.println(Math.min(n - ans0, n - ans1));



	}

	public static boolean XOR(int x, int y) {

		if(x == y) {
			return true;
		}

		return false;
	}

}