
import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args){
        solve();
    }

    public static void solve(){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int oddcount = 0;
        int evencount = 0;
        int n = s.length();
        for(int i=0;i<n;i++){
        	if(i%2==0){
        		if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		}
        	}
        	else{
        		if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		}
        	}
        }

        System.out.println(Math.min(oddcount, evencount));
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main{
    public static void main(String[] args){
        solve();
    }

    public static void solve(){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int oddcount = 0;
        int evencount = 0;
        int n = s.length();
        for(int i=0;i<n;i++){
        	if(i%2==0){
        		if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		}
        	}
        	else{
        		if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		}
        	}
        }

        System.out.println(Math.min(oddcount, evencount));
    }
} Main public static void main(String[] args){
        solve();
    } main {
        solve();
    } solve() solve String[] args args public static void solve(){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int oddcount = 0;
        int evencount = 0;
        int n = s.length();
        for(int i=0;i<n;i++){
        	if(i%2==0){
        		if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		}
        	}
        	else{
        		if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		}
        	}
        }

        System.out.println(Math.min(oddcount, evencount));
    } solve {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int oddcount = 0;
        int evencount = 0;
        int n = s.length();
        for(int i=0;i<n;i++){
        	if(i%2==0){
        		if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		}
        	}
        	else{
        		if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		}
        	}
        }

        System.out.println(Math.min(oddcount, evencount));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int oddcount = 0; oddcount 0 int evencount = 0; evencount 0 int n = s.length(); n s.length() s.length s for(int i=0;i<n;i++){
        	if(i%2==0){
        		if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		}
        	}
        	else{
        		if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		}
        	}
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	if(i%2==0){
        		if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		}
        	}
        	else{
        		if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		}
        	}
        } {
        	if(i%2==0){
        		if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		}
        	}
        	else{
        		if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		}
        	}
        } if(i%2==0){
        		if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		}
        	}
        	else{
        		if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		}
        	} i%2==0 i%2 i 2 0 {
        		if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		}
        	} if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		} s.charAt(i)=='0' s.charAt(i) s.charAt s i '0' {
        			oddcount++;
        		} oddcount++ oddcount {
        			evencount++;
        		} evencount++ evencount {
        		if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		}
        	} if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		} s.charAt(i)=='0' s.charAt(i) s.charAt s i '0' {
        			evencount++;
        		} evencount++ evencount {
        			oddcount++;
        		} oddcount++ oddcount System.out.println(Math.min(oddcount, evencount)) System.out.println System.out System System.out Math.min(oddcount, evencount) Math.min Math oddcount evencount

import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args){
        solve();
    }

    public static void solve(){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int oddcount = 0;
        int evencount = 0;
        int n = s.length();
        for(int i=0;i<n;i++){
        	if(i%2==0){
        		if(s.charAt(i)=='0'){
        			oddcount++;
        		}
        		else{
        			evencount++;
        		}
        	}
        	else{
        		if(s.charAt(i)=='0'){
        			evencount++;
        		}
        		else{
        			oddcount++;
        		}
        	}
        }

        System.out.println(Math.min(oddcount, evencount));
    }
}