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

public class Main {

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        try {
            String string = in.readLine();
            char[] array = string.toCharArray();
            int res = 0;
            for (int i = 1; i < string.length(); i++) {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            }
            System.out.println(res);
        } catch (IOException ex) {

        }
    }

} import java.util.*; util.* java import java.io.*; io.* java public class Main {

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        try {
            String string = in.readLine();
            char[] array = string.toCharArray();
            int res = 0;
            for (int i = 1; i < string.length(); i++) {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            }
            System.out.println(res);
        } catch (IOException ex) {

        }
    }

} Main public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        try {
            String string = in.readLine();
            char[] array = string.toCharArray();
            int res = 0;
            for (int i = 1; i < string.length(); i++) {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            }
            System.out.println(res);
        } catch (IOException ex) {

        }
    } main {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        try {
            String string = in.readLine();
            char[] array = string.toCharArray();
            int res = 0;
            for (int i = 1; i < string.length(); i++) {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            }
            System.out.println(res);
        } catch (IOException ex) {

        }
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) try {
            String string = in.readLine();
            char[] array = string.toCharArray();
            int res = 0;
            for (int i = 1; i < string.length(); i++) {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            }
            System.out.println(res);
        } catch (IOException ex) {

        } catch (IOException ex) {

        } IOException ex {

        } {
            String string = in.readLine();
            char[] array = string.toCharArray();
            int res = 0;
            for (int i = 1; i < string.length(); i++) {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            }
            System.out.println(res);
        } String string = in.readLine(); string in.readLine() in.readLine in char[] array = string.toCharArray(); array string.toCharArray() string.toCharArray string int res = 0; res 0 for (int i = 1; i < string.length(); i++) {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            } int i = 1; int i = 1; i 1 i < string.length() i string.length() string.length string i++ i++ i {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            } {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            } if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                } array[i] == array[i-1] array[i] array i array[i-1] array i-1 i 1 {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                } if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    } array[i] == '0' array[i] array i '0' {
                        array[i] = '1';
                    } array[i] = '1' array[i] array i '1' {
                        array[i] = '0';
                    } array[i] = '0' array[i] array i '0' res++ res System.out.println(res) System.out.println System.out System System.out res String[] args args public class Main {

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        try {
            String string = in.readLine();
            char[] array = string.toCharArray();
            int res = 0;
            for (int i = 1; i < string.length(); i++) {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            }
            System.out.println(res);
        } catch (IOException ex) {

        }
    }

} public class Main {

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        try {
            String string = in.readLine();
            char[] array = string.toCharArray();
            int res = 0;
            for (int i = 1; i < string.length(); i++) {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            }
            System.out.println(res);
        } catch (IOException ex) {

        }
    }

} Main
import java.util.*;
import java.io.*;

public class Main {

    public static void main(String[] args) {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        try {
            String string = in.readLine();
            char[] array = string.toCharArray();
            int res = 0;
            for (int i = 1; i < string.length(); i++) {
                if (array[i] == array[i-1]) {
                    if (array[i] == '0') {
                        array[i] = '1';
                    } else {
                        array[i] = '0';
                    }
                    res++;
                }
            }
            System.out.println(res);
        } catch (IOException ex) {

        }
    }

}