import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int bsta = 0;
        int wsta = 0;
        for (int i = 0; i  < s.length; i ++) {
            if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            }
        }
        System.out.println(Math.min(bsta, wsta));
        sc.close();

    }

} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int bsta = 0;
        int wsta = 0;
        for (int i = 0; i  < s.length; i ++) {
            if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            }
        }
        System.out.println(Math.min(bsta, wsta));
        sc.close();

    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int bsta = 0;
        int wsta = 0;
        for (int i = 0; i  < s.length; i ++) {
            if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            }
        }
        System.out.println(Math.min(bsta, wsta));
        sc.close();

    } main {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int bsta = 0;
        int wsta = 0;
        for (int i = 0; i  < s.length; i ++) {
            if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            }
        }
        System.out.println(Math.min(bsta, wsta));
        sc.close();

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] s = sc.next().toCharArray(); s sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int bsta = 0; bsta 0 int wsta = 0; wsta 0 for (int i = 0; i  < s.length; i ++) {
            if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            }
        } int i = 0; int i = 0; i 0 i  < s.length i s.length s s.length i ++ i ++ i {
            if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            }
        } {
            if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            }
        } if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            } i % 2 == 0 i % 2 i 2 0 {
                if(s[i] == '0') bsta++;
                else wsta++;
            } if(s[i] == '0') bsta++;
                else wsta++; s[i] == '0' s[i] s i '0' bsta++ bsta wsta++ wsta {
                if(s[i] == '1') bsta++;
                else wsta++;
            } if(s[i] == '1') bsta++;
                else wsta++; s[i] == '1' s[i] s i '1' bsta++ bsta wsta++ wsta System.out.println(Math.min(bsta, wsta)) System.out.println System.out System System.out Math.min(bsta, wsta) Math.min Math bsta wsta sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int bsta = 0;
        int wsta = 0;
        for (int i = 0; i  < s.length; i ++) {
            if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            }
        }
        System.out.println(Math.min(bsta, wsta));
        sc.close();

    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int bsta = 0;
        int wsta = 0;
        for (int i = 0; i  < s.length; i ++) {
            if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            }
        }
        System.out.println(Math.min(bsta, wsta));
        sc.close();

    }

} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        int bsta = 0;
        int wsta = 0;
        for (int i = 0; i  < s.length; i ++) {
            if(i % 2 == 0){
                if(s[i] == '0') bsta++;
                else wsta++;
            }else{
                if(s[i] == '1') bsta++;
                else wsta++;
            }
        }
        System.out.println(Math.min(bsta, wsta));
        sc.close();

    }

}
