import java.util.*;

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

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