import java.util.BitSet;
import java.util.Scanner;

class Solver {
    void solve(Scanner sc) {
        String S = sc.next();
        BitSet n = new BitSet(S.length());
        BitSet u = new BitSet(S.length());
        u.set(0);
        for (int i = 1; i < S.length(); i++) {
            boolean eq = S.charAt(i - 1) != S.charAt(i);
            n.set(i, n.get(i - 1) == eq);
            u.set(i, u.get(i - 1) == eq);
        }

        System.out.println(Math.min(n.cardinality(), u.cardinality()));
    }
}

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

        new Solver().solve(in);

        in.close();
    }
} import java.util.BitSet; BitSet java.util import java.util.Scanner; Scanner java.util class Solver {
    void solve(Scanner sc) {
        String S = sc.next();
        BitSet n = new BitSet(S.length());
        BitSet u = new BitSet(S.length());
        u.set(0);
        for (int i = 1; i < S.length(); i++) {
            boolean eq = S.charAt(i - 1) != S.charAt(i);
            n.set(i, n.get(i - 1) == eq);
            u.set(i, u.get(i - 1) == eq);
        }

        System.out.println(Math.min(n.cardinality(), u.cardinality()));
    }
} Solver void solve(Scanner sc) {
        String S = sc.next();
        BitSet n = new BitSet(S.length());
        BitSet u = new BitSet(S.length());
        u.set(0);
        for (int i = 1; i < S.length(); i++) {
            boolean eq = S.charAt(i - 1) != S.charAt(i);
            n.set(i, n.get(i - 1) == eq);
            u.set(i, u.get(i - 1) == eq);
        }

        System.out.println(Math.min(n.cardinality(), u.cardinality()));
    } solve {
        String S = sc.next();
        BitSet n = new BitSet(S.length());
        BitSet u = new BitSet(S.length());
        u.set(0);
        for (int i = 1; i < S.length(); i++) {
            boolean eq = S.charAt(i - 1) != S.charAt(i);
            n.set(i, n.get(i - 1) == eq);
            u.set(i, u.get(i - 1) == eq);
        }

        System.out.println(Math.min(n.cardinality(), u.cardinality()));
    } String S = sc.next(); S sc.next() sc.next sc BitSet n = new BitSet(S.length()); n new BitSet(S.length()) BitSet u = new BitSet(S.length()); u new BitSet(S.length()) u.set(0) u.set u 0 for (int i = 1; i < S.length(); i++) {
            boolean eq = S.charAt(i - 1) != S.charAt(i);
            n.set(i, n.get(i - 1) == eq);
            u.set(i, u.get(i - 1) == eq);
        } int i = 1; int i = 1; i 1 i < S.length() i S.length() S.length S i++ i++ i {
            boolean eq = S.charAt(i - 1) != S.charAt(i);
            n.set(i, n.get(i - 1) == eq);
            u.set(i, u.get(i - 1) == eq);
        } {
            boolean eq = S.charAt(i - 1) != S.charAt(i);
            n.set(i, n.get(i - 1) == eq);
            u.set(i, u.get(i - 1) == eq);
        } boolean eq = S.charAt(i - 1) != S.charAt(i); eq S.charAt(i - 1) != S.charAt(i) S.charAt(i - 1) S.charAt S i - 1 i 1 S.charAt(i) S.charAt S i n.set(i, n.get(i - 1) == eq) n.set n i n.get(i - 1) == eq n.get(i - 1) n.get n i - 1 i 1 eq u.set(i, u.get(i - 1) == eq) u.set u i u.get(i - 1) == eq u.get(i - 1) u.get u i - 1 i 1 eq System.out.println(Math.min(n.cardinality(), u.cardinality())) System.out.println System.out System System.out Math.min(n.cardinality(), u.cardinality()) Math.min Math n.cardinality() n.cardinality n u.cardinality() u.cardinality u Scanner sc sc class Main {
    public static void main(String... args) {
        Scanner in = new Scanner(System.in);

        new Solver().solve(in);

        in.close();
    }
} Main public static void main(String... args) {
        Scanner in = new Scanner(System.in);

        new Solver().solve(in);

        in.close();
    } main {
        Scanner in = new Scanner(System.in);

        new Solver().solve(in);

        in.close();
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) new Solver().solve(in) new Solver().solve new Solver() in in.close() in.close in String... args args
import java.util.BitSet;
import java.util.Scanner;

class Solver {
    void solve(Scanner sc) {
        String S = sc.next();
        BitSet n = new BitSet(S.length());
        BitSet u = new BitSet(S.length());
        u.set(0);
        for (int i = 1; i < S.length(); i++) {
            boolean eq = S.charAt(i - 1) != S.charAt(i);
            n.set(i, n.get(i - 1) == eq);
            u.set(i, u.get(i - 1) == eq);
        }

        System.out.println(Math.min(n.cardinality(), u.cardinality()));
    }
}

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

        new Solver().solve(in);

        in.close();
    }
}