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