import java.util.Scanner;

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

        String S = sc.nextLine();

        int count0 = 0;
        int count1 = 0;
        boolean flg = true;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            }
            flg = !flg;
        }

        System.out.println(Math.min(count0, count1));
    }
} 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.nextLine();

        int count0 = 0;
        int count1 = 0;
        boolean flg = true;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            }
            flg = !flg;
        }

        System.out.println(Math.min(count0, count1));
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);

        String S = sc.nextLine();

        int count0 = 0;
        int count1 = 0;
        boolean flg = true;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            }
            flg = !flg;
        }

        System.out.println(Math.min(count0, count1));
    } main {
        Scanner sc = new Scanner(System.in);

        String S = sc.nextLine();

        int count0 = 0;
        int count1 = 0;
        boolean flg = true;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            }
            flg = !flg;
        }

        System.out.println(Math.min(count0, count1));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc int count0 = 0; count0 0 int count1 = 0; count1 0 boolean flg = true; flg true for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            }
            flg = !flg;
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            }
            flg = !flg;
        } {
            if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            }
            flg = !flg;
        } if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            } S.charAt(i) == (flg ? '0' : '1') S.charAt(i) S.charAt S i (flg ? '0' : '1') flg '0' '1' {
                count0++;
            } count0++ count0 {
                count1++;
            } count1++ count1 flg = !flg flg !flg flg System.out.println(Math.min(count0, count1)) System.out.println System.out System System.out Math.min(count0, count1) Math.min Math count0 count1 String args[] args public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);

        String S = sc.nextLine();

        int count0 = 0;
        int count1 = 0;
        boolean flg = true;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            }
            flg = !flg;
        }

        System.out.println(Math.min(count0, count1));
    }
} public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);

        String S = sc.nextLine();

        int count0 = 0;
        int count1 = 0;
        boolean flg = true;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            }
            flg = !flg;
        }

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

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

        String S = sc.nextLine();

        int count0 = 0;
        int count1 = 0;
        boolean flg = true;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (flg ? '0' : '1')) {
                count0++;
            } else {
                count1++;
            }
            flg = !flg;
        }

        System.out.println(Math.min(count0, count1));
    }
}
