import java.util.Scanner;

public class Main {


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

		int ans = s.length();

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

			int cnt = 0;

			for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			}

			ans = Math.min(ans, cnt);
		}

		System.out.println(ans);
	}

} 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.nextLine();

		int ans = s.length();

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

			int cnt = 0;

			for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			}

			ans = Math.min(ans, cnt);
		}

		System.out.println(ans);
	}

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

		int ans = s.length();

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

			int cnt = 0;

			for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			}

			ans = Math.min(ans, cnt);
		}

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();

		int ans = s.length();

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

			int cnt = 0;

			for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			}

			ans = Math.min(ans, cnt);
		}

		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc int ans = s.length(); ans s.length() s.length s for (int i = 0; i < 2; i++) {

			int cnt = 0;

			for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			}

			ans = Math.min(ans, cnt);
		} int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {

			int cnt = 0;

			for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			}

			ans = Math.min(ans, cnt);
		} {

			int cnt = 0;

			for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			}

			ans = Math.min(ans, cnt);
		} int cnt = 0; cnt 0 for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			} int j = 0; int j = 0; j 0 j < s.length() j s.length() s.length s j++ j++ j {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			} {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			} if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++; j % 2 == 0 && s.charAt(j) != (char)(i + '0') j % 2 == 0 j % 2 j 2 0 s.charAt(j) != (char)(i + '0') s.charAt(j) s.charAt s j (char)(i + '0') i '0' cnt++ cnt if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++; j % 2 == 1 && s.charAt(j) == (char)(i + '0') j % 2 == 1 j % 2 j 2 1 s.charAt(j) == (char)(i + '0') s.charAt(j) s.charAt s j (char)(i + '0') i '0' cnt++ cnt ans = Math.min(ans, cnt) ans Math.min(ans, cnt) Math.min Math ans cnt System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {


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

		int ans = s.length();

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

			int cnt = 0;

			for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			}

			ans = Math.min(ans, cnt);
		}

		System.out.println(ans);
	}

} public class Main {


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

		int ans = s.length();

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

			int cnt = 0;

			for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			}

			ans = Math.min(ans, cnt);
		}

		System.out.println(ans);
	}

} Main
import java.util.Scanner;

public class Main {


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

		int ans = s.length();

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

			int cnt = 0;

			for (int j = 0; j < s.length(); j++) {
				if(j % 2 == 0 && s.charAt(j) != (char)(i + '0')) cnt++;
				if(j % 2 == 1 && s.charAt(j) == (char)(i + '0')) cnt++;
			}

			ans = Math.min(ans, cnt);
		}

		System.out.println(ans);
	}

}