import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        char[] S = sc.next().toCharArray();
        int N = S.length;

        int cnt1 = 0;
        int cnt2 = 0;
        for (int i = 0; i < N; i++) {
            if (i % 2 == 0) {
                if (S[i] != '0') cnt1++;
                if (S[i] != '1') cnt2++;
            } else {
                if (S[i] != '1') cnt1++;
                if (S[i] != '0') cnt2++;
            }
        }

        System.out.println(Math.min(cnt1, cnt2));
        return;
    }

} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
} Main public static void main(String[] args) {
        new Solver().run();
    } main {
        new Solver().run();
    } new Solver().run() new Solver().run new Solver() String[] args args class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        char[] S = sc.next().toCharArray();
        int N = S.length;

        int cnt1 = 0;
        int cnt2 = 0;
        for (int i = 0; i < N; i++) {
            if (i % 2 == 0) {
                if (S[i] != '0') cnt1++;
                if (S[i] != '1') cnt2++;
            } else {
                if (S[i] != '1') cnt1++;
                if (S[i] != '0') cnt2++;
            }
        }

        System.out.println(Math.min(cnt1, cnt2));
        return;
    }

} Solver public void run() {
        Scanner sc = new Scanner(System.in);
        char[] S = sc.next().toCharArray();
        int N = S.length;

        int cnt1 = 0;
        int cnt2 = 0;
        for (int i = 0; i < N; i++) {
            if (i % 2 == 0) {
                if (S[i] != '0') cnt1++;
                if (S[i] != '1') cnt2++;
            } else {
                if (S[i] != '1') cnt1++;
                if (S[i] != '0') cnt2++;
            }
        }

        System.out.println(Math.min(cnt1, cnt2));
        return;
    } run {
        Scanner sc = new Scanner(System.in);
        char[] S = sc.next().toCharArray();
        int N = S.length;

        int cnt1 = 0;
        int cnt2 = 0;
        for (int i = 0; i < N; i++) {
            if (i % 2 == 0) {
                if (S[i] != '0') cnt1++;
                if (S[i] != '1') cnt2++;
            } else {
                if (S[i] != '1') cnt1++;
                if (S[i] != '0') cnt2++;
            }
        }

        System.out.println(Math.min(cnt1, cnt2));
        return;
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] S = sc.next().toCharArray(); S sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int N = S.length; N S.length S S.length int cnt1 = 0; cnt1 0 int cnt2 = 0; cnt2 0 for (int i = 0; i < N; i++) {
            if (i % 2 == 0) {
                if (S[i] != '0') cnt1++;
                if (S[i] != '1') cnt2++;
            } else {
                if (S[i] != '1') cnt1++;
                if (S[i] != '0') cnt2++;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (i % 2 == 0) {
                if (S[i] != '0') cnt1++;
                if (S[i] != '1') cnt2++;
            } else {
                if (S[i] != '1') cnt1++;
                if (S[i] != '0') cnt2++;
            }
        } {
            if (i % 2 == 0) {
                if (S[i] != '0') cnt1++;
                if (S[i] != '1') cnt2++;
            } else {
                if (S[i] != '1') cnt1++;
                if (S[i] != '0') cnt2++;
            }
        } if (i % 2 == 0) {
                if (S[i] != '0') cnt1++;
                if (S[i] != '1') cnt2++;
            } else {
                if (S[i] != '1') cnt1++;
                if (S[i] != '0') cnt2++;
            } i % 2 == 0 i % 2 i 2 0 {
                if (S[i] != '0') cnt1++;
                if (S[i] != '1') cnt2++;
            } if (S[i] != '0') cnt1++; S[i] != '0' S[i] S i '0' cnt1++ cnt1 if (S[i] != '1') cnt2++; S[i] != '1' S[i] S i '1' cnt2++ cnt2 {
                if (S[i] != '1') cnt1++;
                if (S[i] != '0') cnt2++;
            } if (S[i] != '1') cnt1++; S[i] != '1' S[i] S i '1' cnt1++ cnt1 if (S[i] != '0') cnt2++; S[i] != '0' S[i] S i '0' cnt2++ cnt2 System.out.println(Math.min(cnt1, cnt2)) System.out.println System.out System System.out Math.min(cnt1, cnt2) Math.min Math cnt1 cnt2 return;
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        char[] S = sc.next().toCharArray();
        int N = S.length;

        int cnt1 = 0;
        int cnt2 = 0;
        for (int i = 0; i < N; i++) {
            if (i % 2 == 0) {
                if (S[i] != '0') cnt1++;
                if (S[i] != '1') cnt2++;
            } else {
                if (S[i] != '1') cnt1++;
                if (S[i] != '0') cnt2++;
            }
        }

        System.out.println(Math.min(cnt1, cnt2));
        return;
    }

}