import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int width = S.length();
        int cnt = 0;
        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int width = S.length();
        int cnt = 0;
        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int width = S.length();
        int cnt = 0;
        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    } main {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int width = S.length();
        int cnt = 0;
        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int width = S.length(); width S.length() S.length S int cnt = 0; cnt 0 int forward = 0; forward 0 int backward = 0; backward 0 for (int i = 0; i < S.length(); i++) {
            if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            }
        } {
            if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            }
        } if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            } (S.charAt(i) - 48) != ((i + 1) % 2) (S.charAt(i) - 48) S.charAt(i) S.charAt S i 48 ((i + 1) % 2) (i + 1) i 1 2 {
                forward++;
            } forward++ forward {
                backward++;
            } backward++ backward System.out.println(Math.min(forward, backward)) System.out.println System.out System System.out Math.min(forward, backward) Math.min Math forward backward String[] args args public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int width = S.length();
        int cnt = 0;
        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int width = S.length();
        int cnt = 0;
        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int width = S.length();
        int cnt = 0;
        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if ((S.charAt(i) - 48) != ((i + 1) % 2)) {
                forward++;
            } else {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    }
}
