import java.util.Scanner;

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

        String S = scanner.next();

        int[] sArray = new int[S.length()];
        int[] zeroArray = new int[S.length()];
        int[] oneArray = new int[S.length()];

        for(int i=0; i<sArray.length; i++){
            if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            }

            if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            }
        }

        int oneDiff = 0;
        int zeroDIff = 0;

        for(int i=0; i<sArray.length; i++){
            if(sArray[i] != oneArray[i]){
                oneDiff++;
            }

            if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            }
        }

        System.out.println(Math.min(oneDiff, zeroDIff));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String S = scanner.next();

        int[] sArray = new int[S.length()];
        int[] zeroArray = new int[S.length()];
        int[] oneArray = new int[S.length()];

        for(int i=0; i<sArray.length; i++){
            if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            }

            if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            }
        }

        int oneDiff = 0;
        int zeroDIff = 0;

        for(int i=0; i<sArray.length; i++){
            if(sArray[i] != oneArray[i]){
                oneDiff++;
            }

            if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            }
        }

        System.out.println(Math.min(oneDiff, zeroDIff));
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String S = scanner.next();

        int[] sArray = new int[S.length()];
        int[] zeroArray = new int[S.length()];
        int[] oneArray = new int[S.length()];

        for(int i=0; i<sArray.length; i++){
            if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            }

            if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            }
        }

        int oneDiff = 0;
        int zeroDIff = 0;

        for(int i=0; i<sArray.length; i++){
            if(sArray[i] != oneArray[i]){
                oneDiff++;
            }

            if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            }
        }

        System.out.println(Math.min(oneDiff, zeroDIff));
    } main {
        Scanner scanner = new Scanner(System.in);

        String S = scanner.next();

        int[] sArray = new int[S.length()];
        int[] zeroArray = new int[S.length()];
        int[] oneArray = new int[S.length()];

        for(int i=0; i<sArray.length; i++){
            if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            }

            if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            }
        }

        int oneDiff = 0;
        int zeroDIff = 0;

        for(int i=0; i<sArray.length; i++){
            if(sArray[i] != oneArray[i]){
                oneDiff++;
            }

            if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            }
        }

        System.out.println(Math.min(oneDiff, zeroDIff));
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String S = scanner.next(); S scanner.next() scanner.next scanner int[] sArray = new int[S.length()]; sArray new int[S.length()] S.length() S.length S int[] zeroArray = new int[S.length()]; zeroArray new int[S.length()] S.length() S.length S int[] oneArray = new int[S.length()]; oneArray new int[S.length()] S.length() S.length S for(int i=0; i<sArray.length; i++){
            if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            }

            if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            }
        } int i=0; int i=0; i 0 i<sArray.length i sArray.length sArray sArray.length i++ i++ i {
            if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            }

            if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            }
        } {
            if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            }

            if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            }
        } if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            } S.charAt(i) == '0' S.charAt(i) S.charAt S i '0' {
                sArray[i] = 0;
            } sArray[i] = 0 sArray[i] sArray i 0 {
                sArray[i] = 1;
            } sArray[i] = 1 sArray[i] sArray i 1 if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            } i % 2 == 0 i % 2 i 2 0 {
                zeroArray[i] = 0;
                oneArray[i] = 1;
            } zeroArray[i] = 0 zeroArray[i] zeroArray i 0 oneArray[i] = 1 oneArray[i] oneArray i 1 {
                zeroArray[i] = 1;
                oneArray[i] = 0;
            } zeroArray[i] = 1 zeroArray[i] zeroArray i 1 oneArray[i] = 0 oneArray[i] oneArray i 0 int oneDiff = 0; oneDiff 0 int zeroDIff = 0; zeroDIff 0 for(int i=0; i<sArray.length; i++){
            if(sArray[i] != oneArray[i]){
                oneDiff++;
            }

            if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            }
        } int i=0; int i=0; i 0 i<sArray.length i sArray.length sArray sArray.length i++ i++ i {
            if(sArray[i] != oneArray[i]){
                oneDiff++;
            }

            if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            }
        } {
            if(sArray[i] != oneArray[i]){
                oneDiff++;
            }

            if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            }
        } if(sArray[i] != oneArray[i]){
                oneDiff++;
            } sArray[i] != oneArray[i] sArray[i] sArray i oneArray[i] oneArray i {
                oneDiff++;
            } oneDiff++ oneDiff if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            } sArray[i] != zeroArray[i] sArray[i] sArray i zeroArray[i] zeroArray i {
                zeroDIff++;
            } zeroDIff++ zeroDIff System.out.println(Math.min(oneDiff, zeroDIff)) System.out.println System.out System System.out Math.min(oneDiff, zeroDIff) Math.min Math oneDiff zeroDIff String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String S = scanner.next();

        int[] sArray = new int[S.length()];
        int[] zeroArray = new int[S.length()];
        int[] oneArray = new int[S.length()];

        for(int i=0; i<sArray.length; i++){
            if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            }

            if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            }
        }

        int oneDiff = 0;
        int zeroDIff = 0;

        for(int i=0; i<sArray.length; i++){
            if(sArray[i] != oneArray[i]){
                oneDiff++;
            }

            if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            }
        }

        System.out.println(Math.min(oneDiff, zeroDIff));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String S = scanner.next();

        int[] sArray = new int[S.length()];
        int[] zeroArray = new int[S.length()];
        int[] oneArray = new int[S.length()];

        for(int i=0; i<sArray.length; i++){
            if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            }

            if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            }
        }

        int oneDiff = 0;
        int zeroDIff = 0;

        for(int i=0; i<sArray.length; i++){
            if(sArray[i] != oneArray[i]){
                oneDiff++;
            }

            if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            }
        }

        System.out.println(Math.min(oneDiff, zeroDIff));
    }
} Main
import java.util.Scanner;

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

        String S = scanner.next();

        int[] sArray = new int[S.length()];
        int[] zeroArray = new int[S.length()];
        int[] oneArray = new int[S.length()];

        for(int i=0; i<sArray.length; i++){
            if(S.charAt(i) == '0'){
                sArray[i] = 0;
            }else{
                sArray[i] = 1;
            }

            if(i % 2 == 0){
                zeroArray[i] = 0;
                oneArray[i] = 1;
            }else{
                zeroArray[i] = 1;
                oneArray[i] = 0;
            }
        }

        int oneDiff = 0;
        int zeroDIff = 0;

        for(int i=0; i<sArray.length; i++){
            if(sArray[i] != oneArray[i]){
                oneDiff++;
            }

            if(sArray[i] != zeroArray[i]){
                zeroDIff++;
            }
        }

        System.out.println(Math.min(oneDiff, zeroDIff));
    }
}
