import java.util.Scanner;

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

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

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

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

        char[] s = sc.next().toCharArray();
        
        int a = 0;
        int b = 0;
        for (int i = 0; i < s.length; i++) {
            char c = s[i];
            if (i % 2 == 0) {
                if (c == '0')
                    a++;
                else
                    b++;
            } else {
                if (c == '1')
                    a++;
                else
                    b++;
            }
        }
        
        System.out.println(Math.min(a, b));
    } 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 a = 0; a 0 int b = 0; b 0 for (int i = 0; i < s.length; i++) {
            char c = s[i];
            if (i % 2 == 0) {
                if (c == '0')
                    a++;
                else
                    b++;
            } else {
                if (c == '1')
                    a++;
                else
                    b++;
            }
        } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
            char c = s[i];
            if (i % 2 == 0) {
                if (c == '0')
                    a++;
                else
                    b++;
            } else {
                if (c == '1')
                    a++;
                else
                    b++;
            }
        } {
            char c = s[i];
            if (i % 2 == 0) {
                if (c == '0')
                    a++;
                else
                    b++;
            } else {
                if (c == '1')
                    a++;
                else
                    b++;
            }
        } char c = s[i]; c s[i] s i if (i % 2 == 0) {
                if (c == '0')
                    a++;
                else
                    b++;
            } else {
                if (c == '1')
                    a++;
                else
                    b++;
            } i % 2 == 0 i % 2 i 2 0 {
                if (c == '0')
                    a++;
                else
                    b++;
            } if (c == '0')
                    a++;
                else
                    b++; c == '0' c '0' a++ a b++ b {
                if (c == '1')
                    a++;
                else
                    b++;
            } if (c == '1')
                    a++;
                else
                    b++; c == '1' c '1' a++ a b++ b System.out.println(Math.min(a, b)) System.out.println System.out System System.out Math.min(a, b) Math.min Math a b String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

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

        char[] s = sc.next().toCharArray();
        
        int a = 0;
        int b = 0;
        for (int i = 0; i < s.length; i++) {
            char c = s[i];
            if (i % 2 == 0) {
                if (c == '0')
                    a++;
                else
                    b++;
            } else {
                if (c == '1')
                    a++;
                else
                    b++;
            }
        }
        
        System.out.println(Math.min(a, b));
    }
} Main
import java.util.Scanner;

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

        char[] s = sc.next().toCharArray();
        
        int a = 0;
        int b = 0;
        for (int i = 0; i < s.length; i++) {
            char c = s[i];
            if (i % 2 == 0) {
                if (c == '0')
                    a++;
                else
                    b++;
            } else {
                if (c == '1')
                    a++;
                else
                    b++;
            }
        }
        
        System.out.println(Math.min(a, b));
    }
}
