import java.util.*;
import java.util.stream.Stream;

public class Main {//ここが Main になっている
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String line1;
        int[] k_n_array = new int[2];
        line1 = sc.nextLine();
        String[] strArray = line1.split("");
        // for (int i = 0; i < strArray.length; i++) {// // "strArray"を1文字ずつ表示
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
        // }
        int count=0;
        for (int i = 0; i < strArray.length; i++) {
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
            // System.out.println(i % 2 == 0);
            // System.out.println(strArray[i]);
            // System.out.println(strArray[i].equals("0"));
            if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            }
            if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            }
        }
        int another = strArray.length - count;
        if (count >= another){
            System.out.println(another);
        }
        else{
            System.out.println(count);
        }
    }
} import java.util.*; util.* java import java.util.stream.Stream; Stream java.util.stream public class Main {//ここが Main になっている
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String line1;
        int[] k_n_array = new int[2];
        line1 = sc.nextLine();
        String[] strArray = line1.split("");
        // for (int i = 0; i < strArray.length; i++) {// // "strArray"を1文字ずつ表示
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
        // }
        int count=0;
        for (int i = 0; i < strArray.length; i++) {
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
            // System.out.println(i % 2 == 0);
            // System.out.println(strArray[i]);
            // System.out.println(strArray[i].equals("0"));
            if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            }
            if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            }
        }
        int another = strArray.length - count;
        if (count >= another){
            System.out.println(another);
        }
        else{
            System.out.println(count);
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String line1;
        int[] k_n_array = new int[2];
        line1 = sc.nextLine();
        String[] strArray = line1.split("");
        // for (int i = 0; i < strArray.length; i++) {// // "strArray"を1文字ずつ表示
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
        // }
        int count=0;
        for (int i = 0; i < strArray.length; i++) {
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
            // System.out.println(i % 2 == 0);
            // System.out.println(strArray[i]);
            // System.out.println(strArray[i].equals("0"));
            if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            }
            if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            }
        }
        int another = strArray.length - count;
        if (count >= another){
            System.out.println(another);
        }
        else{
            System.out.println(count);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String line1;
        int[] k_n_array = new int[2];
        line1 = sc.nextLine();
        String[] strArray = line1.split("");
        // for (int i = 0; i < strArray.length; i++) {// // "strArray"を1文字ずつ表示
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
        // }
        int count=0;
        for (int i = 0; i < strArray.length; i++) {
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
            // System.out.println(i % 2 == 0);
            // System.out.println(strArray[i]);
            // System.out.println(strArray[i].equals("0"));
            if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            }
            if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            }
        }
        int another = strArray.length - count;
        if (count >= another){
            System.out.println(another);
        }
        else{
            System.out.println(count);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line1; line1 int[] k_n_array = new int[2]; k_n_array new int[2] 2 line1 = sc.nextLine() line1 sc.nextLine() sc.nextLine sc String[] strArray = line1.split(""); strArray line1.split("") line1.split line1 "" int count=0; count 0 for (int i = 0; i < strArray.length; i++) {
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
            // System.out.println(i % 2 == 0);
            // System.out.println(strArray[i]);
            // System.out.println(strArray[i].equals("0"));
            if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            }
            if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            }
        } int i = 0; int i = 0; i 0 i < strArray.length i strArray.length strArray strArray.length i++ i++ i {
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
            // System.out.println(i % 2 == 0);
            // System.out.println(strArray[i]);
            // System.out.println(strArray[i].equals("0"));
            if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            }
            if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            }
        } {
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
            // System.out.println(i % 2 == 0);
            // System.out.println(strArray[i]);
            // System.out.println(strArray[i].equals("0"));
            if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            }
            if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            }
        } if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            } i % 2 == 0 & strArray[i].equals("0") i % 2 == 0 i % 2 i 2 0 strArray[i].equals("0") strArray[i].equals strArray[i] strArray i "0" {
                // System.out.println("a");
                count++;
            } count++ count if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            } i % 2 == 1 && strArray[i].equals("1") i % 2 == 1 i % 2 i 2 1 strArray[i].equals("1") strArray[i].equals strArray[i] strArray i "1" {
                // System.out.println("b");
                count++;
            } count++ count int another = strArray.length - count; another strArray.length - count strArray.length strArray strArray.length count if (count >= another){
            System.out.println(another);
        }
        else{
            System.out.println(count);
        } count >= another count another {
            System.out.println(another);
        } System.out.println(another) System.out.println System.out System System.out another {
            System.out.println(count);
        } System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {//ここが Main になっている
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String line1;
        int[] k_n_array = new int[2];
        line1 = sc.nextLine();
        String[] strArray = line1.split("");
        // for (int i = 0; i < strArray.length; i++) {// // "strArray"を1文字ずつ表示
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
        // }
        int count=0;
        for (int i = 0; i < strArray.length; i++) {
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
            // System.out.println(i % 2 == 0);
            // System.out.println(strArray[i]);
            // System.out.println(strArray[i].equals("0"));
            if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            }
            if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            }
        }
        int another = strArray.length - count;
        if (count >= another){
            System.out.println(another);
        }
        else{
            System.out.println(count);
        }
    }
} public class Main {//ここが Main になっている
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String line1;
        int[] k_n_array = new int[2];
        line1 = sc.nextLine();
        String[] strArray = line1.split("");
        // for (int i = 0; i < strArray.length; i++) {// // "strArray"を1文字ずつ表示
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
        // }
        int count=0;
        for (int i = 0; i < strArray.length; i++) {
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
            // System.out.println(i % 2 == 0);
            // System.out.println(strArray[i]);
            // System.out.println(strArray[i].equals("0"));
            if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            }
            if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            }
        }
        int another = strArray.length - count;
        if (count >= another){
            System.out.println(another);
        }
        else{
            System.out.println(count);
        }
    }
} Main
import java.util.*;
import java.util.stream.Stream;

public class Main {//ここが Main になっている
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String line1;
        int[] k_n_array = new int[2];
        line1 = sc.nextLine();
        String[] strArray = line1.split("");
        // for (int i = 0; i < strArray.length; i++) {// // "strArray"を1文字ずつ表示
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
        // }
        int count=0;
        for (int i = 0; i < strArray.length; i++) {
            // System.out.println("strArrayの要素番号" + i + "の時：" + strArray[i]);
            // System.out.println(i % 2 == 0);
            // System.out.println(strArray[i]);
            // System.out.println(strArray[i].equals("0"));
            if (i % 2 == 0 & strArray[i].equals("0")){
                // System.out.println("a");
                count++;
            }
            if (i % 2 == 1 && strArray[i].equals("1")){
                // System.out.println("b");
                count++;
            }
        }
        int another = strArray.length - count;
        if (count >= another){
            System.out.println(another);
        }
        else{
            System.out.println(count);
        }
    }
}
