import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        String beforechar = "";
        int count = 0;

        for(int i = 0; i < S.length(); i++){
            if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            }
        }

        System.out.println(count);

    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        String beforechar = "";
        int count = 0;

        for(int i = 0; i < S.length(); i++){
            if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            }
        }

        System.out.println(count);

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        String beforechar = "";
        int count = 0;

        for(int i = 0; i < S.length(); i++){
            if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            }
        }

        System.out.println(count);

    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        String beforechar = "";
        int count = 0;

        for(int i = 0; i < S.length(); i++){
            if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            }
        }

        System.out.println(count);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc sc.close() sc.close sc String beforechar = ""; beforechar "" int count = 0; count 0 for(int i = 0; i < S.length(); i++){
            if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            }
        } {
            if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            }
        } if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            } i==0 i 0 {
                beforechar = S.substring(i,i+1);
            } beforechar = S.substring(i,i+1) beforechar S.substring(i,i+1) S.substring S i i+1 i 1 {
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            } if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                } S.substring(i,i+1).equals(beforechar) S.substring(i,i+1).equals S.substring(i,i+1) S.substring S i i+1 i 1 beforechar {
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                } count ++ count if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   } beforechar.equals("0") beforechar.equals beforechar "0" {
                        beforechar = "1";
                   } beforechar = "1" beforechar "1" {
                       beforechar = "0";
                   } beforechar = "0" beforechar "0" {
                    beforechar = S.substring(i,i+1);
                } beforechar = S.substring(i,i+1) beforechar S.substring(i,i+1) S.substring S i i+1 i 1 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        String beforechar = "";
        int count = 0;

        for(int i = 0; i < S.length(); i++){
            if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            }
        }

        System.out.println(count);

    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        String beforechar = "";
        int count = 0;

        for(int i = 0; i < S.length(); i++){
            if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            }
        }

        System.out.println(count);

    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        sc.close();
        String beforechar = "";
        int count = 0;

        for(int i = 0; i < S.length(); i++){
            if(i==0){
                beforechar = S.substring(i,i+1);
            }else{
                if(S.substring(i,i+1).equals(beforechar)){
                   count ++;
                   if(beforechar.equals("0")){
                        beforechar = "1";
                   }else{
                       beforechar = "0";
                   }
                }else{
                    beforechar = S.substring(i,i+1);
                }
            }
        }

        System.out.println(count);

    }
}