
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split("");
        int res1=0;
        int res2=0;
        for(int i=0;i<s.length;i++){
            if(i%2==0){
                if(s[i].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            }
        }
        for(int i=0;i<s.length;i++){
            if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            }
        }
        System.out.println(Math.min(res1, res2));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split("");
        int res1=0;
        int res2=0;
        for(int i=0;i<s.length;i++){
            if(i%2==0){
                if(s[i].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            }
        }
        for(int i=0;i<s.length;i++){
            if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            }
        }
        System.out.println(Math.min(res1, res2));
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split("");
        int res1=0;
        int res2=0;
        for(int i=0;i<s.length;i++){
            if(i%2==0){
                if(s[i].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            }
        }
        for(int i=0;i<s.length;i++){
            if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            }
        }
        System.out.println(Math.min(res1, res2));
    } main {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split("");
        int res1=0;
        int res2=0;
        for(int i=0;i<s.length;i++){
            if(i%2==0){
                if(s[i].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            }
        }
        for(int i=0;i<s.length;i++){
            if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            }
        }
        System.out.println(Math.min(res1, res2));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] s = sc.nextLine().split(""); s sc.nextLine().split("") sc.nextLine().split sc.nextLine() sc.nextLine sc "" int res1=0; res1 0 int res2=0; res2 0 for(int i=0;i<s.length;i++){
            if(i%2==0){
                if(s[i].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            }
        } 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].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            }
        } {
            if(i%2==0){
                if(s[i].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            }
        } if(i%2==0){
                if(s[i].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            } i%2==0 i%2 i 2 0 {
                if(s[i].equals("0"))res1++;
            } if(s[i].equals("0"))res1++; s[i].equals("0") s[i].equals s[i] s i "0" res1++ res1 {
                if(s[i].equals("1"))res1++;
            } if(s[i].equals("1"))res1++; s[i].equals("1") s[i].equals s[i] s i "1" res1++ res1 for(int i=0;i<s.length;i++){
            if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            }
        } int i=0; int i=0; i 0 i<s.length i s.length s s.length i++ i++ i {
            if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            }
        } {
            if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            }
        } if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            } i%2==1 i%2 i 2 1 {
                if(s[i].equals("0"))res2++;
            } if(s[i].equals("0"))res2++; s[i].equals("0") s[i].equals s[i] s i "0" res2++ res2 {
                if(s[i].equals("1"))res2++;
            } if(s[i].equals("1"))res2++; s[i].equals("1") s[i].equals s[i] s i "1" res2++ res2 System.out.println(Math.min(res1, res2)) System.out.println System.out System System.out Math.min(res1, res2) Math.min Math res1 res2 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split("");
        int res1=0;
        int res2=0;
        for(int i=0;i<s.length;i++){
            if(i%2==0){
                if(s[i].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            }
        }
        for(int i=0;i<s.length;i++){
            if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            }
        }
        System.out.println(Math.min(res1, res2));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split("");
        int res1=0;
        int res2=0;
        for(int i=0;i<s.length;i++){
            if(i%2==0){
                if(s[i].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            }
        }
        for(int i=0;i<s.length;i++){
            if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            }
        }
        System.out.println(Math.min(res1, res2));
    }
} Main

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.nextLine().split("");
        int res1=0;
        int res2=0;
        for(int i=0;i<s.length;i++){
            if(i%2==0){
                if(s[i].equals("0"))res1++;
            }
            else{
                if(s[i].equals("1"))res1++;
            }
        }
        for(int i=0;i<s.length;i++){
            if(i%2==1){
                if(s[i].equals("0"))res2++;
            }
            else{
                if(s[i].equals("1"))res2++;
            }
        }
        System.out.println(Math.min(res1, res2));
    }
}