import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        char[] charArray = input.toCharArray();
        int length = charArray.length;

        char[] shiroKuro = new char[length];
        char[] kuroShiro = new char[length];
        for (int i=0; i<length; i++) {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        }

        int shiroKuroCount = 0;
        int kuroShiroCount = 0;

        for (int i=0; i<length; i++) {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        }

        System.out.println(Math.min(shiroKuroCount, kuroShiroCount));
    }
} import java.io.File; File java.io import java.io.FileInputStream; FileInputStream java.io import java.io.FileNotFoundException; FileNotFoundException java.io import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        char[] charArray = input.toCharArray();
        int length = charArray.length;

        char[] shiroKuro = new char[length];
        char[] kuroShiro = new char[length];
        for (int i=0; i<length; i++) {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        }

        int shiroKuroCount = 0;
        int kuroShiroCount = 0;

        for (int i=0; i<length; i++) {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        }

        System.out.println(Math.min(shiroKuroCount, kuroShiroCount));
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        char[] charArray = input.toCharArray();
        int length = charArray.length;

        char[] shiroKuro = new char[length];
        char[] kuroShiro = new char[length];
        for (int i=0; i<length; i++) {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        }

        int shiroKuroCount = 0;
        int kuroShiroCount = 0;

        for (int i=0; i<length; i++) {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        }

        System.out.println(Math.min(shiroKuroCount, kuroShiroCount));
    } main {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        char[] charArray = input.toCharArray();
        int length = charArray.length;

        char[] shiroKuro = new char[length];
        char[] kuroShiro = new char[length];
        for (int i=0; i<length; i++) {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        }

        int shiroKuroCount = 0;
        int kuroShiroCount = 0;

        for (int i=0; i<length; i++) {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        }

        System.out.println(Math.min(shiroKuroCount, kuroShiroCount));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.next(); input sc.next() sc.next sc char[] charArray = input.toCharArray(); charArray input.toCharArray() input.toCharArray input int length = charArray.length; length charArray.length charArray charArray.length char[] shiroKuro = new char[length]; shiroKuro new char[length] length char[] kuroShiro = new char[length]; kuroShiro new char[length] length for (int i=0; i<length; i++) {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        } int i=0; int i=0; i 0 i<length i length i++ i++ i {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        } {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        } if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            } i % 2 == 0 i % 2 i 2 0 {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } shiroKuro[i] = '0' shiroKuro[i] shiroKuro i '0' kuroShiro[i] = '1' kuroShiro[i] kuroShiro i '1' {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            } shiroKuro[i] = '1' shiroKuro[i] shiroKuro i '1' kuroShiro[i] = '0' kuroShiro[i] kuroShiro i '0' int shiroKuroCount = 0; shiroKuroCount 0 int kuroShiroCount = 0; kuroShiroCount 0 for (int i=0; i<length; i++) {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        } int i=0; int i=0; i 0 i<length i length i++ i++ i {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        } {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        } if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            } charArray[i] != shiroKuro[i] charArray[i] charArray i shiroKuro[i] shiroKuro i {
                shiroKuroCount++;
            } shiroKuroCount++ shiroKuroCount if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            } charArray[i] != kuroShiro[i] charArray[i] charArray i kuroShiro[i] kuroShiro i {
                kuroShiroCount++;
            } kuroShiroCount++ kuroShiroCount System.out.println(Math.min(shiroKuroCount, kuroShiroCount)) System.out.println System.out System System.out Math.min(shiroKuroCount, kuroShiroCount) Math.min Math shiroKuroCount kuroShiroCount String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        char[] charArray = input.toCharArray();
        int length = charArray.length;

        char[] shiroKuro = new char[length];
        char[] kuroShiro = new char[length];
        for (int i=0; i<length; i++) {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        }

        int shiroKuroCount = 0;
        int kuroShiroCount = 0;

        for (int i=0; i<length; i++) {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        }

        System.out.println(Math.min(shiroKuroCount, kuroShiroCount));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        char[] charArray = input.toCharArray();
        int length = charArray.length;

        char[] shiroKuro = new char[length];
        char[] kuroShiro = new char[length];
        for (int i=0; i<length; i++) {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        }

        int shiroKuroCount = 0;
        int kuroShiroCount = 0;

        for (int i=0; i<length; i++) {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        }

        System.out.println(Math.min(shiroKuroCount, kuroShiroCount));
    }
} Main
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String input = sc.next();
        char[] charArray = input.toCharArray();
        int length = charArray.length;

        char[] shiroKuro = new char[length];
        char[] kuroShiro = new char[length];
        for (int i=0; i<length; i++) {
            if (i % 2 == 0) {
                shiroKuro[i] = '0';
                kuroShiro[i] = '1';
            } else {
                shiroKuro[i] = '1';
                kuroShiro[i] = '0';
            }
        }

        int shiroKuroCount = 0;
        int kuroShiroCount = 0;

        for (int i=0; i<length; i++) {
            if (charArray[i] != shiroKuro[i]) {
                shiroKuroCount++;
            }

            if (charArray[i] != kuroShiro[i]) {
                kuroShiroCount++;
            }
        }

        System.out.println(Math.min(shiroKuroCount, kuroShiroCount));
    }
}
