import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char c[] = s.toCharArray();
		int couA=0;
int couB=0;
		for (int i = 0; i < c.length; i++) {
			if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			}
		}
		for (int i = 0; i < c.length; i++) {
			if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			}
		}
	System.out.println(Math.min(couA, couB));
	}
} 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();
		char c[] = s.toCharArray();
		int couA=0;
int couB=0;
		for (int i = 0; i < c.length; i++) {
			if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			}
		}
		for (int i = 0; i < c.length; i++) {
			if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			}
		}
	System.out.println(Math.min(couA, couB));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char c[] = s.toCharArray();
		int couA=0;
int couB=0;
		for (int i = 0; i < c.length; i++) {
			if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			}
		}
		for (int i = 0; i < c.length; i++) {
			if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			}
		}
	System.out.println(Math.min(couA, couB));
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char c[] = s.toCharArray();
		int couA=0;
int couB=0;
		for (int i = 0; i < c.length; i++) {
			if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			}
		}
		for (int i = 0; i < c.length; i++) {
			if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			}
		}
	System.out.println(Math.min(couA, couB));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc char c[] = s.toCharArray(); c s.toCharArray() s.toCharArray s int couA=0; couA 0 int couB=0; couB 0 for (int i = 0; i < c.length; i++) {
			if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			}
		} int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
			if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			}
		} {
			if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			}
		} if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			} i % 2 == 0 i % 2 i 2 0 {
				if(c[i]=='0'){couA++;}
			} if(c[i]=='0'){couA++;} c[i]=='0' c[i] c i '0' {couA++;} couA++ couA {
				if(c[i]!='0'){couA++;}
			} if(c[i]!='0'){couA++;} c[i]!='0' c[i] c i '0' {couA++;} couA++ couA for (int i = 0; i < c.length; i++) {
			if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			}
		} int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
			if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			}
		} {
			if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			}
		} if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			} i % 2 != 0 i % 2 i 2 0 {
				if(c[i]=='0'){couB++;}
			} if(c[i]=='0'){couB++;} c[i]=='0' c[i] c i '0' {couB++;} couB++ couB {
				if(c[i]!='0'){couB++;}
			} if(c[i]!='0'){couB++;} c[i]!='0' c[i] c i '0' {couB++;} couB++ couB System.out.println(Math.min(couA, couB)) System.out.println System.out System System.out Math.min(couA, couB) Math.min Math couA couB String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char c[] = s.toCharArray();
		int couA=0;
int couB=0;
		for (int i = 0; i < c.length; i++) {
			if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			}
		}
		for (int i = 0; i < c.length; i++) {
			if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			}
		}
	System.out.println(Math.min(couA, couB));
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char c[] = s.toCharArray();
		int couA=0;
int couB=0;
		for (int i = 0; i < c.length; i++) {
			if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			}
		}
		for (int i = 0; i < c.length; i++) {
			if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			}
		}
	System.out.println(Math.min(couA, couB));
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		char c[] = s.toCharArray();
		int couA=0;
int couB=0;
		for (int i = 0; i < c.length; i++) {
			if (i % 2 == 0) {
				if(c[i]=='0'){couA++;}
			} else {
				if(c[i]!='0'){couA++;}
			}
		}
		for (int i = 0; i < c.length; i++) {
			if (i % 2 != 0) {
				if(c[i]=='0'){couB++;}
			} else {
				if(c[i]!='0'){couB++;}
			}
		}
	System.out.println(Math.min(couA, couB));
	}
}