import java.util.Scanner;

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

        String s = sc.next();

        int target = 0;
        int changedCntFrm0 = 0;
        int changedCntFrm1 = 0;

        int tile[] = new int[s.length()];

        for (int i = 0; i < s.length(); i++) {

            tile[i] = s.charAt(i);
        }


        for (int i = 0; i < s.length(); i++) {

            if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            }
            if (tile[i] != target) {
                changedCntFrm0++;
            }
        }

        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            }
            if (tile[i] != target) {
                changedCntFrm1++;
            }
        }
        if (changedCntFrm0 >= changedCntFrm1){
            System.out.println(changedCntFrm1);
        }else{
            System.out.println(changedCntFrm0);
        }
        sc.close();
    }
} 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 target = 0;
        int changedCntFrm0 = 0;
        int changedCntFrm1 = 0;

        int tile[] = new int[s.length()];

        for (int i = 0; i < s.length(); i++) {

            tile[i] = s.charAt(i);
        }


        for (int i = 0; i < s.length(); i++) {

            if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            }
            if (tile[i] != target) {
                changedCntFrm0++;
            }
        }

        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            }
            if (tile[i] != target) {
                changedCntFrm1++;
            }
        }
        if (changedCntFrm0 >= changedCntFrm1){
            System.out.println(changedCntFrm1);
        }else{
            System.out.println(changedCntFrm0);
        }
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        int target = 0;
        int changedCntFrm0 = 0;
        int changedCntFrm1 = 0;

        int tile[] = new int[s.length()];

        for (int i = 0; i < s.length(); i++) {

            tile[i] = s.charAt(i);
        }


        for (int i = 0; i < s.length(); i++) {

            if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            }
            if (tile[i] != target) {
                changedCntFrm0++;
            }
        }

        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            }
            if (tile[i] != target) {
                changedCntFrm1++;
            }
        }
        if (changedCntFrm0 >= changedCntFrm1){
            System.out.println(changedCntFrm1);
        }else{
            System.out.println(changedCntFrm0);
        }
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        int target = 0;
        int changedCntFrm0 = 0;
        int changedCntFrm1 = 0;

        int tile[] = new int[s.length()];

        for (int i = 0; i < s.length(); i++) {

            tile[i] = s.charAt(i);
        }


        for (int i = 0; i < s.length(); i++) {

            if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            }
            if (tile[i] != target) {
                changedCntFrm0++;
            }
        }

        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            }
            if (tile[i] != target) {
                changedCntFrm1++;
            }
        }
        if (changedCntFrm0 >= changedCntFrm1){
            System.out.println(changedCntFrm1);
        }else{
            System.out.println(changedCntFrm0);
        }
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int target = 0; target 0 int changedCntFrm0 = 0; changedCntFrm0 0 int changedCntFrm1 = 0; changedCntFrm1 0 int tile[] = new int[s.length()]; tile new int[s.length()] s.length() s.length s for (int i = 0; i < s.length(); i++) {

            tile[i] = s.charAt(i);
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {

            tile[i] = s.charAt(i);
        } {

            tile[i] = s.charAt(i);
        } tile[i] = s.charAt(i) tile[i] tile i s.charAt(i) s.charAt s i for (int i = 0; i < s.length(); i++) {

            if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            }
            if (tile[i] != target) {
                changedCntFrm0++;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {

            if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            }
            if (tile[i] != target) {
                changedCntFrm0++;
            }
        } {

            if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            }
            if (tile[i] != target) {
                changedCntFrm0++;
            }
        } if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            } i % 2 == 0 i % 2 i 2 0 {
                target = 48;
            } target = 48 target 48 {
                target = 49;
            } target = 49 target 49 if (tile[i] != target) {
                changedCntFrm0++;
            } tile[i] != target tile[i] tile i target {
                changedCntFrm0++;
            } changedCntFrm0++ changedCntFrm0 for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            }
            if (tile[i] != target) {
                changedCntFrm1++;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            }
            if (tile[i] != target) {
                changedCntFrm1++;
            }
        } {
            if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            }
            if (tile[i] != target) {
                changedCntFrm1++;
            }
        } if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            } i % 2 == 0 i % 2 i 2 0 {
                target = 49;
            } target = 49 target 49 {
                target = 48;
            } target = 48 target 48 if (tile[i] != target) {
                changedCntFrm1++;
            } tile[i] != target tile[i] tile i target {
                changedCntFrm1++;
            } changedCntFrm1++ changedCntFrm1 if (changedCntFrm0 >= changedCntFrm1){
            System.out.println(changedCntFrm1);
        }else{
            System.out.println(changedCntFrm0);
        } changedCntFrm0 >= changedCntFrm1 changedCntFrm0 changedCntFrm1 {
            System.out.println(changedCntFrm1);
        } System.out.println(changedCntFrm1) System.out.println System.out System System.out changedCntFrm1 {
            System.out.println(changedCntFrm0);
        } System.out.println(changedCntFrm0) System.out.println System.out System System.out changedCntFrm0 sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        int target = 0;
        int changedCntFrm0 = 0;
        int changedCntFrm1 = 0;

        int tile[] = new int[s.length()];

        for (int i = 0; i < s.length(); i++) {

            tile[i] = s.charAt(i);
        }


        for (int i = 0; i < s.length(); i++) {

            if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            }
            if (tile[i] != target) {
                changedCntFrm0++;
            }
        }

        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            }
            if (tile[i] != target) {
                changedCntFrm1++;
            }
        }
        if (changedCntFrm0 >= changedCntFrm1){
            System.out.println(changedCntFrm1);
        }else{
            System.out.println(changedCntFrm0);
        }
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String s = sc.next();

        int target = 0;
        int changedCntFrm0 = 0;
        int changedCntFrm1 = 0;

        int tile[] = new int[s.length()];

        for (int i = 0; i < s.length(); i++) {

            tile[i] = s.charAt(i);
        }


        for (int i = 0; i < s.length(); i++) {

            if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            }
            if (tile[i] != target) {
                changedCntFrm0++;
            }
        }

        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            }
            if (tile[i] != target) {
                changedCntFrm1++;
            }
        }
        if (changedCntFrm0 >= changedCntFrm1){
            System.out.println(changedCntFrm1);
        }else{
            System.out.println(changedCntFrm0);
        }
        sc.close();
    }
} 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 target = 0;
        int changedCntFrm0 = 0;
        int changedCntFrm1 = 0;

        int tile[] = new int[s.length()];

        for (int i = 0; i < s.length(); i++) {

            tile[i] = s.charAt(i);
        }


        for (int i = 0; i < s.length(); i++) {

            if (i % 2 == 0) {
                target = 48;
            } else {
                target = 49;
            }
            if (tile[i] != target) {
                changedCntFrm0++;
            }
        }

        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                target = 49;
            } else {
                target = 48;
            }
            if (tile[i] != target) {
                changedCntFrm1++;
            }
        }
        if (changedCntFrm0 >= changedCntFrm1){
            System.out.println(changedCntFrm1);
        }else{
            System.out.println(changedCntFrm0);
        }
        sc.close();
    }
}
