

import java.util.Arrays;
import java.util.Scanner;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        int len = s.length();

        int cnt0 = 0, cnt1 = 0;
        for (int i = 0; i < len; i++) {
            if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            }
        }

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

    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }

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

    void run() {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        int len = s.length();

        int cnt0 = 0, cnt1 = 0;
        for (int i = 0; i < len; i++) {
            if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            }
        }

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

    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }

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

        String s = sc.next();

        int len = s.length();

        int cnt0 = 0, cnt1 = 0;
        for (int i = 0; i < len; i++) {
            if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            }
        }

        System.out.println(Math.min(cnt0, cnt1));
    } run {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        int len = s.length();

        int cnt0 = 0, cnt1 = 0;
        for (int i = 0; i < len; i++) {
            if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            }
        }

        System.out.println(Math.min(cnt0, cnt1));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int len = s.length(); len s.length() s.length s int cnt0 = 0 cnt0 0 cnt1 = 0; cnt1 0 for (int i = 0; i < len; i++) {
            if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            }
        } int i = 0; int i = 0; i 0 i < len i len i++ i++ i {
            if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            }
        } {
            if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            }
        } if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            } s.charAt(i) != ((i % 2 == 0) ? '0' : '1') s.charAt(i) s.charAt s i ((i % 2 == 0) ? '0' : '1') (i % 2 == 0) i % 2 i 2 0 '0' '1' {
                cnt0++;
            } cnt0++ cnt0 {
                cnt1++;
            } cnt1++ cnt1 System.out.println(Math.min(cnt0, cnt1)) System.out.println System.out System System.out Math.min(cnt0, cnt1) Math.min Math cnt0 cnt1 void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    } debug {
        System.err.println(Arrays.deepToString(os));
    } System.err.println(Arrays.deepToString(os)) System.err.println System.err System System.err Arrays.deepToString(os) Arrays.deepToString Arrays os Object...os os public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        int len = s.length();

        int cnt0 = 0, cnt1 = 0;
        for (int i = 0; i < len; i++) {
            if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            }
        }

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

    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }

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

    void run() {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        int len = s.length();

        int cnt0 = 0, cnt1 = 0;
        for (int i = 0; i < len; i++) {
            if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            }
        }

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

    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }

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


import java.util.Arrays;
import java.util.Scanner;

public class Main {

    void run() {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        int len = s.length();

        int cnt0 = 0, cnt1 = 0;
        for (int i = 0; i < len; i++) {
            if (s.charAt(i) != ((i % 2 == 0) ? '0' : '1')) {
                cnt0++;
            } else {
                cnt1++;
            }
        }

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

    void debug(Object...os) {
        System.err.println(Arrays.deepToString(os));
    }

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