import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = 0;
        int count = 0;
        for(int i=0;i<s.length();i++){
          if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;}}
        ans = Math.min(count,s.length()-count);
		System.out.println(ans);
  }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = 0;
        int count = 0;
        for(int i=0;i<s.length();i++){
          if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;}}
        ans = Math.min(count,s.length()-count);
		System.out.println(ans);
  }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = 0;
        int count = 0;
        for(int i=0;i<s.length();i++){
          if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;}}
        ans = Math.min(count,s.length()-count);
		System.out.println(ans);
  } main {
		Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = 0;
        int count = 0;
        for(int i=0;i<s.length();i++){
          if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;}}
        ans = Math.min(count,s.length()-count);
		System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int ans = 0; ans 0 int count = 0; count 0 for(int i=0;i<s.length();i++){
          if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;}} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
          if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;}} {
          if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;}} if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;} (i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1') (i%2==0 && s.charAt(i)=='0') i%2==0 i%2 i 2 0 s.charAt(i)=='0' s.charAt(i) s.charAt s i '0' (i%2==1 && s.charAt(i)=='1') i%2==1 i%2 i 2 1 s.charAt(i)=='1' s.charAt(i) s.charAt s i '1' {count++;} count++ count ans = Math.min(count,s.length()-count) ans Math.min(count,s.length()-count) Math.min Math count s.length()-count s.length() s.length s count 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.next();
        int ans = 0;
        int count = 0;
        for(int i=0;i<s.length();i++){
          if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;}}
        ans = Math.min(count,s.length()-count);
		System.out.println(ans);
  }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = 0;
        int count = 0;
        for(int i=0;i<s.length();i++){
          if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;}}
        ans = Math.min(count,s.length()-count);
		System.out.println(ans);
  }
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int ans = 0;
        int count = 0;
        for(int i=0;i<s.length();i++){
          if((i%2==0 && s.charAt(i)=='0')||(i%2==1 && s.charAt(i)=='1')){count++;}}
        ans = Math.min(count,s.length()-count);
		System.out.println(ans);
  }
}
