import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    String S = sc.nextLine();
		int odd0 = 0;
		int odd1 = 0;
		int even0 = 0;
		int even1 = 0;
		for(int i=0;i<S.length();i++) {
			char c = S.charAt(i);
			if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			}
		}
		System.out.println(Math.min(odd0+even1, odd1+even0));
    
  }
}
     import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    String S = sc.nextLine();
		int odd0 = 0;
		int odd1 = 0;
		int even0 = 0;
		int even1 = 0;
		for(int i=0;i<S.length();i++) {
			char c = S.charAt(i);
			if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			}
		}
		System.out.println(Math.min(odd0+even1, odd1+even0));
    
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    String S = sc.nextLine();
		int odd0 = 0;
		int odd1 = 0;
		int even0 = 0;
		int even1 = 0;
		for(int i=0;i<S.length();i++) {
			char c = S.charAt(i);
			if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			}
		}
		System.out.println(Math.min(odd0+even1, odd1+even0));
    
  } main {
    Scanner sc = new Scanner(System.in);
    
    String S = sc.nextLine();
		int odd0 = 0;
		int odd1 = 0;
		int even0 = 0;
		int even1 = 0;
		for(int i=0;i<S.length();i++) {
			char c = S.charAt(i);
			if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			}
		}
		System.out.println(Math.min(odd0+even1, odd1+even0));
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc int odd0 = 0; odd0 0 int odd1 = 0; odd1 0 int even0 = 0; even0 0 int even1 = 0; even1 0 for(int i=0;i<S.length();i++) {
			char c = S.charAt(i);
			if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			}
		} int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
			char c = S.charAt(i);
			if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			}
		} {
			char c = S.charAt(i);
			if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			}
		} char c = S.charAt(i); c S.charAt(i) S.charAt S i if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			} i%2==0 i%2 i 2 0 {
				if(c=='0') even0++;
				else even1++;
			} if(c=='0') even0++;
				else even1++; c=='0' c '0' even0++ even0 even1++ even1 {
				if(c=='0') odd0++;
				else odd1++;
			} if(c=='0') odd0++;
				else odd1++; c=='0' c '0' odd0++ odd0 odd1++ odd1 System.out.println(Math.min(odd0+even1, odd1+even0)) System.out.println System.out System System.out Math.min(odd0+even1, odd1+even0) Math.min Math odd0+even1 odd0 even1 odd1+even0 odd1 even0 String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    String S = sc.nextLine();
		int odd0 = 0;
		int odd1 = 0;
		int even0 = 0;
		int even1 = 0;
		for(int i=0;i<S.length();i++) {
			char c = S.charAt(i);
			if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			}
		}
		System.out.println(Math.min(odd0+even1, odd1+even0));
    
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    String S = sc.nextLine();
		int odd0 = 0;
		int odd1 = 0;
		int even0 = 0;
		int even1 = 0;
		for(int i=0;i<S.length();i++) {
			char c = S.charAt(i);
			if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			}
		}
		System.out.println(Math.min(odd0+even1, odd1+even0));
    
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    String S = sc.nextLine();
		int odd0 = 0;
		int odd1 = 0;
		int even0 = 0;
		int even1 = 0;
		for(int i=0;i<S.length();i++) {
			char c = S.charAt(i);
			if(i%2==0) {
				if(c=='0') even0++;
				else even1++;
			}else {
				if(c=='0') odd0++;
				else odd1++;
			}
		}
		System.out.println(Math.min(odd0+even1, odd1+even0));
    
  }
}
    