import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String s = sc.next();
        int count = 0;
        String[] sar = s.split("");
        for (int i = 1; i < s.length(); i++) {
            if (sar[i-1].equals(sar[i])) {
                count++;
                if (sar[i].equals("0")) {
                    sar[i] = "1";
                } else {
                    sar[i] = "0";
                }
            }
        }
        System.out.println(count);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String s = sc.next();
        int count = 0;
        String[] sar = s.split("");
        for (int i = 1; i < s.length(); i++) {
            if (sar[i-1].equals(sar[i])) {
                count++;
                if (sar[i].equals("0")) {
                    sar[i] = "1";
                } else {
                    sar[i] = "0";
                }
            }
        }
        System.out.println(count);
    }

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

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String s = sc.next();
        int count = 0;
        String[] sar = s.split("");
        for (int i = 1; i < s.length(); i++) {
            if (sar[i-1].equals(sar[i])) {
                count++;
                if (sar[i].equals("0")) {
                    sar[i] = "1";
                } else {
                    sar[i] = "0";
                }
            }
        }
        System.out.println(count);
    }

} public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String s = sc.next();
        int count = 0;
        String[] sar = s.split("");
        for (int i = 1; i < s.length(); i++) {
            if (sar[i-1].equals(sar[i])) {
                count++;
                if (sar[i].equals("0")) {
                    sar[i] = "1";
                } else {
                    sar[i] = "0";
                }
            }
        }
        System.out.println(count);
    }

} Main
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        String s = sc.next();
        int count = 0;
        String[] sar = s.split("");
        for (int i = 1; i < s.length(); i++) {
            if (sar[i-1].equals(sar[i])) {
                count++;
                if (sar[i].equals("0")) {
                    sar[i] = "1";
                } else {
                    sar[i] = "0";
                }
            }
        }
        System.out.println(count);
    }

}
