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