import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		int len = s.length();

		int[] A = new int[len];
		int[] B = new int[len];

		int i;
		for(i = 0; i < len; i++) {
			A[i] = i % 2;
			B[i] = (i + 1) % 2;
		}

		int tempA = 0;
		int tempB = 0;
		int intS;
		for(i = 0; i < len; i++) {
			intS = Integer.parseInt(s.substring(i, i + 1));

			if(intS != A[i])
				tempA++;

			if(intS != B[i])
				tempB++;
		}

		System.out.println(Math.min(tempA, tempB));
	}
} 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.next();
		int len = s.length();

		int[] A = new int[len];
		int[] B = new int[len];

		int i;
		for(i = 0; i < len; i++) {
			A[i] = i % 2;
			B[i] = (i + 1) % 2;
		}

		int tempA = 0;
		int tempB = 0;
		int intS;
		for(i = 0; i < len; i++) {
			intS = Integer.parseInt(s.substring(i, i + 1));

			if(intS != A[i])
				tempA++;

			if(intS != B[i])
				tempB++;
		}

		System.out.println(Math.min(tempA, tempB));
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		int len = s.length();

		int[] A = new int[len];
		int[] B = new int[len];

		int i;
		for(i = 0; i < len; i++) {
			A[i] = i % 2;
			B[i] = (i + 1) % 2;
		}

		int tempA = 0;
		int tempB = 0;
		int intS;
		for(i = 0; i < len; i++) {
			intS = Integer.parseInt(s.substring(i, i + 1));

			if(intS != A[i])
				tempA++;

			if(intS != B[i])
				tempB++;
		}

		System.out.println(Math.min(tempA, tempB));
	} main {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		int len = s.length();

		int[] A = new int[len];
		int[] B = new int[len];

		int i;
		for(i = 0; i < len; i++) {
			A[i] = i % 2;
			B[i] = (i + 1) % 2;
		}

		int tempA = 0;
		int tempB = 0;
		int intS;
		for(i = 0; i < len; i++) {
			intS = Integer.parseInt(s.substring(i, i + 1));

			if(intS != A[i])
				tempA++;

			if(intS != B[i])
				tempB++;
		}

		System.out.println(Math.min(tempA, tempB));
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan int len = s.length(); len s.length() s.length s int[] A = new int[len]; A new int[len] len int[] B = new int[len]; B new int[len] len int i; i for(i = 0; i < len; i++) {
			A[i] = i % 2;
			B[i] = (i + 1) % 2;
		} i = 0; i = 0 i 0 i < len i len i++ i++ i {
			A[i] = i % 2;
			B[i] = (i + 1) % 2;
		} {
			A[i] = i % 2;
			B[i] = (i + 1) % 2;
		} A[i] = i % 2 A[i] A i i % 2 i 2 B[i] = (i + 1) % 2 B[i] B i (i + 1) % 2 (i + 1) i 1 2 int tempA = 0; tempA 0 int tempB = 0; tempB 0 int intS; intS for(i = 0; i < len; i++) {
			intS = Integer.parseInt(s.substring(i, i + 1));

			if(intS != A[i])
				tempA++;

			if(intS != B[i])
				tempB++;
		} i = 0; i = 0 i 0 i < len i len i++ i++ i {
			intS = Integer.parseInt(s.substring(i, i + 1));

			if(intS != A[i])
				tempA++;

			if(intS != B[i])
				tempB++;
		} {
			intS = Integer.parseInt(s.substring(i, i + 1));

			if(intS != A[i])
				tempA++;

			if(intS != B[i])
				tempB++;
		} intS = Integer.parseInt(s.substring(i, i + 1)) intS Integer.parseInt(s.substring(i, i + 1)) Integer.parseInt Integer s.substring(i, i + 1) s.substring s i i + 1 i 1 if(intS != A[i])
				tempA++; intS != A[i] intS A[i] A i tempA++ tempA if(intS != B[i])
				tempB++; intS != B[i] intS B[i] B i tempB++ tempB System.out.println(Math.min(tempA, tempB)) System.out.println System.out System System.out Math.min(tempA, tempB) Math.min Math tempA tempB String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		int len = s.length();

		int[] A = new int[len];
		int[] B = new int[len];

		int i;
		for(i = 0; i < len; i++) {
			A[i] = i % 2;
			B[i] = (i + 1) % 2;
		}

		int tempA = 0;
		int tempB = 0;
		int intS;
		for(i = 0; i < len; i++) {
			intS = Integer.parseInt(s.substring(i, i + 1));

			if(intS != A[i])
				tempA++;

			if(intS != B[i])
				tempB++;
		}

		System.out.println(Math.min(tempA, tempB));
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		int len = s.length();

		int[] A = new int[len];
		int[] B = new int[len];

		int i;
		for(i = 0; i < len; i++) {
			A[i] = i % 2;
			B[i] = (i + 1) % 2;
		}

		int tempA = 0;
		int tempB = 0;
		int intS;
		for(i = 0; i < len; i++) {
			intS = Integer.parseInt(s.substring(i, i + 1));

			if(intS != A[i])
				tempA++;

			if(intS != B[i])
				tempB++;
		}

		System.out.println(Math.min(tempA, tempB));
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		int len = s.length();

		int[] A = new int[len];
		int[] B = new int[len];

		int i;
		for(i = 0; i < len; i++) {
			A[i] = i % 2;
			B[i] = (i + 1) % 2;
		}

		int tempA = 0;
		int tempB = 0;
		int intS;
		for(i = 0; i < len; i++) {
			intS = Integer.parseInt(s.substring(i, i + 1));

			if(intS != A[i])
				tempA++;

			if(intS != B[i])
				tempB++;
		}

		System.out.println(Math.min(tempA, tempB));
	}
}
