
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		String str=scn.next();
		int cnt0=0,cnt1=0;
		char alt0='0',alt1='1';
		for(int i=0;i<str.length();i++) {
			if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			}
			if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			}
		}
		System.out.println(Math.min(cnt0, cnt1));
	}

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		String str=scn.next();
		int cnt0=0,cnt1=0;
		char alt0='0',alt1='1';
		for(int i=0;i<str.length();i++) {
			if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			}
			if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			}
		}
		System.out.println(Math.min(cnt0, cnt1));
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		String str=scn.next();
		int cnt0=0,cnt1=0;
		char alt0='0',alt1='1';
		for(int i=0;i<str.length();i++) {
			if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			}
			if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			}
		}
		System.out.println(Math.min(cnt0, cnt1));
	} main {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		String str=scn.next();
		int cnt0=0,cnt1=0;
		char alt0='0',alt1='1';
		for(int i=0;i<str.length();i++) {
			if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			}
			if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			}
		}
		System.out.println(Math.min(cnt0, cnt1));
	} Scanner scn=new Scanner(System.in); scn new Scanner(System.in) String str=scn.next(); str scn.next() scn.next scn int cnt0=0 cnt0 0 cnt1=0; cnt1 0 char alt0='0' alt0 '0' alt1='1'; alt1 '1' for(int i=0;i<str.length();i++) {
			if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			}
			if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			}
		} int i=0; int i=0; i 0 i<str.length() i str.length() str.length str i++ i++ i {
			if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			}
			if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			}
		} {
			if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			}
			if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			}
		} if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			} str.charAt(i)==alt0 str.charAt(i) str.charAt str i alt0 {
				cnt1++;
			} cnt1++ cnt1 {
				cnt0++;
			} cnt0++ cnt0 if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			} alt0=='0' alt0 '0' {
				alt0='1';
				alt1='0';
			} alt0='1' alt0 '1' alt1='0' alt1 '0' {
				alt0='0';
				alt1='1';
			} alt0='0' alt0 '0' alt1='1' alt1 '1' System.out.println(Math.min(cnt0, cnt1)) System.out.println System.out System System.out Math.min(cnt0, cnt1) Math.min Math cnt0 cnt1 String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		String str=scn.next();
		int cnt0=0,cnt1=0;
		char alt0='0',alt1='1';
		for(int i=0;i<str.length();i++) {
			if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			}
			if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			}
		}
		System.out.println(Math.min(cnt0, cnt1));
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		String str=scn.next();
		int cnt0=0,cnt1=0;
		char alt0='0',alt1='1';
		for(int i=0;i<str.length();i++) {
			if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			}
			if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			}
		}
		System.out.println(Math.min(cnt0, cnt1));
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		String str=scn.next();
		int cnt0=0,cnt1=0;
		char alt0='0',alt1='1';
		for(int i=0;i<str.length();i++) {
			if(str.charAt(i)==alt0) {
				cnt1++;
			}else {
				cnt0++;
			}
			if(alt0=='0') {
				alt0='1';
				alt1='0';
			}else {
				alt0='0';
				alt1='1';
			}
		}
		System.out.println(Math.min(cnt0, cnt1));
	}

}
