import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] arr = s.toCharArray();
        arr[0] = arr[0] == '0' ? '1' : '0';
        System.out.println(Math.min(painted(arr, 1), painted(s.toCharArray(), 0)));
    }

    private static int painted(char[] arr, int count) {
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            }
        }
        return count;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] arr = s.toCharArray();
        arr[0] = arr[0] == '0' ? '1' : '0';
        System.out.println(Math.min(painted(arr, 1), painted(s.toCharArray(), 0)));
    }

    private static int painted(char[] arr, int count) {
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            }
        }
        return count;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] arr = s.toCharArray();
        arr[0] = arr[0] == '0' ? '1' : '0';
        System.out.println(Math.min(painted(arr, 1), painted(s.toCharArray(), 0)));
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] arr = s.toCharArray();
        arr[0] = arr[0] == '0' ? '1' : '0';
        System.out.println(Math.min(painted(arr, 1), painted(s.toCharArray(), 0)));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc char[] arr = s.toCharArray(); arr s.toCharArray() s.toCharArray s arr[0] = arr[0] == '0' ? '1' : '0' arr[0] arr 0 arr[0] == '0' ? '1' : '0' arr[0] == '0' arr[0] arr 0 '0' '1' '0' System.out.println(Math.min(painted(arr, 1), painted(s.toCharArray(), 0))) System.out.println System.out System System.out Math.min(painted(arr, 1), painted(s.toCharArray(), 0)) Math.min Math painted(arr, 1) painted arr 1 painted(s.toCharArray(), 0) painted s.toCharArray() s.toCharArray s 0 String[] args args private static int painted(char[] arr, int count) {
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            }
        }
        return count;
    } painted {
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            }
        }
        return count;
    } for (int i = 1; i < arr.length; i++) {
            if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            }
        } int i = 1; int i = 1; i 1 i < arr.length i arr.length arr arr.length i++ i++ i {
            if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            }
        } {
            if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            }
        } if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            } arr[i] == arr[i-1] arr[i] arr i arr[i-1] arr i-1 i 1 {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            } count++ count arr[i] = arr[i] == '0' ? '1' : '0' arr[i] arr i arr[i] == '0' ? '1' : '0' arr[i] == '0' arr[i] arr i '0' '1' '0' return count; count char[] arr arr int count count public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] arr = s.toCharArray();
        arr[0] = arr[0] == '0' ? '1' : '0';
        System.out.println(Math.min(painted(arr, 1), painted(s.toCharArray(), 0)));
    }

    private static int painted(char[] arr, int count) {
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            }
        }
        return count;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] arr = s.toCharArray();
        arr[0] = arr[0] == '0' ? '1' : '0';
        System.out.println(Math.min(painted(arr, 1), painted(s.toCharArray(), 0)));
    }

    private static int painted(char[] arr, int count) {
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            }
        }
        return count;
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        char[] arr = s.toCharArray();
        arr[0] = arr[0] == '0' ? '1' : '0';
        System.out.println(Math.min(painted(arr, 1), painted(s.toCharArray(), 0)));
    }

    private static int painted(char[] arr, int count) {
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] == arr[i-1]) {
                count++;
                arr[i] = arr[i] == '0' ? '1' : '0';
            }
        }
        return count;
    }
}