import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int l = S.length();
        char[] s = new char[l];
        String a = "01";
        int ans = 0;

        for(int i=0; i<l; i++){
            s[i] = S.charAt(i);
        }

        for(int i=1; i<l; i++){
            if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            }
        }
        System.out.println(ans);
    }
} 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 l = S.length();
        char[] s = new char[l];
        String a = "01";
        int ans = 0;

        for(int i=0; i<l; i++){
            s[i] = S.charAt(i);
        }

        for(int i=1; i<l; i++){
            if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int l = S.length();
        char[] s = new char[l];
        String a = "01";
        int ans = 0;

        for(int i=0; i<l; i++){
            s[i] = S.charAt(i);
        }

        for(int i=1; i<l; i++){
            if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int l = S.length();
        char[] s = new char[l];
        String a = "01";
        int ans = 0;

        for(int i=0; i<l; i++){
            s[i] = S.charAt(i);
        }

        for(int i=1; i<l; i++){
            if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int l = S.length(); l S.length() S.length S char[] s = new char[l]; s new char[l] l String a = "01"; a "01" int ans = 0; ans 0 for(int i=0; i<l; i++){
            s[i] = S.charAt(i);
        } int i=0; int i=0; i 0 i<l i l i++ i++ i {
            s[i] = S.charAt(i);
        } {
            s[i] = S.charAt(i);
        } s[i] = S.charAt(i) s[i] s i S.charAt(i) S.charAt S i for(int i=1; i<l; i++){
            if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            }
        } int i=1; int i=1; i 1 i<l i l i++ i++ i {
            if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            }
        } {
            if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            }
        } if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            } s[i]==s[i-1] s[i] s i s[i-1] s i-1 i 1 {
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            } if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                } s[i-1]==a.charAt(0) s[i-1] s i-1 i 1 a.charAt(0) a.charAt a 0 {
                    s[i] = a.charAt(1);
                } s[i] = a.charAt(1) s[i] s i a.charAt(1) a.charAt a 1 if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                } s[i-1]==a.charAt(1) s[i-1] s i-1 i 1 a.charAt(1) a.charAt a 1 {
                    s[i] = a.charAt(0);
                } s[i] = a.charAt(0) s[i] s i a.charAt(0) a.charAt a 0 ans += 1 ans 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int l = S.length();
        char[] s = new char[l];
        String a = "01";
        int ans = 0;

        for(int i=0; i<l; i++){
            s[i] = S.charAt(i);
        }

        for(int i=1; i<l; i++){
            if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            }
        }
        System.out.println(ans);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int l = S.length();
        char[] s = new char[l];
        String a = "01";
        int ans = 0;

        for(int i=0; i<l; i++){
            s[i] = S.charAt(i);
        }

        for(int i=1; i<l; i++){
            if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        int l = S.length();
        char[] s = new char[l];
        String a = "01";
        int ans = 0;

        for(int i=0; i<l; i++){
            s[i] = S.charAt(i);
        }

        for(int i=1; i<l; i++){
            if(s[i]==s[i-1]){
                if(s[i-1]==a.charAt(0)){
                    s[i] = a.charAt(1);
                }
                else if(s[i-1]==a.charAt(1)){
                    s[i] = a.charAt(0);
                }
                ans += 1;
            }
        }
        System.out.println(ans);
    }
}