import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        List<Integer> list = new ArrayList<>();

        if(str.length() == 1) {
            System.out.println(0);
        } else {
            for(int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            }
            int minCount = list.size();
            for(int i = 0; i < 2; i++) {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            }

            System.out.println(minCount);
        }

    }
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        List<Integer> list = new ArrayList<>();

        if(str.length() == 1) {
            System.out.println(0);
        } else {
            for(int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            }
            int minCount = list.size();
            for(int i = 0; i < 2; i++) {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            }

            System.out.println(minCount);
        }

    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        List<Integer> list = new ArrayList<>();

        if(str.length() == 1) {
            System.out.println(0);
        } else {
            for(int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            }
            int minCount = list.size();
            for(int i = 0; i < 2; i++) {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            }

            System.out.println(minCount);
        }

    } main {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        List<Integer> list = new ArrayList<>();

        if(str.length() == 1) {
            System.out.println(0);
        } else {
            for(int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            }
            int minCount = list.size();
            for(int i = 0; i < 2; i++) {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            }

            System.out.println(minCount);
        }

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String str = scanner.next(); str scanner.next() scanner.next scanner List<Integer> list = new ArrayList<>(); list new ArrayList<>() if(str.length() == 1) {
            System.out.println(0);
        } else {
            for(int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            }
            int minCount = list.size();
            for(int i = 0; i < 2; i++) {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            }

            System.out.println(minCount);
        } str.length() == 1 str.length() str.length str 1 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            for(int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            }
            int minCount = list.size();
            for(int i = 0; i < 2; i++) {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            }

            System.out.println(minCount);
        } for(int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            } {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            } char c = str.charAt(i); c str.charAt(i) str.charAt str i list.add(Character.getNumericValue(c)) list.add list Character.getNumericValue(c) Character.getNumericValue Character c int minCount = list.size(); minCount list.size() list.size list for(int i = 0; i < 2; i++) {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            } {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            } int count = 0; count 0 for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                } int j = 0; int j = 0; j 0 j < list.size() j list.size() list.size list j++ j++ j {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                } {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                } if(j % 2 == 0 && list.get(j) != i) count++; j % 2 == 0 && list.get(j) != i j % 2 == 0 j % 2 j 2 0 list.get(j) != i list.get(j) list.get list j i count++ count if(j % 2 == 1 && list.get(j) == i) count++; j % 2 == 1 && list.get(j) == i j % 2 == 1 j % 2 j 2 1 list.get(j) == i list.get(j) list.get list j i count++ count if(minCount >= count) minCount = count; minCount >= count minCount count minCount = count minCount count System.out.println(minCount) System.out.println System.out System System.out minCount String[] args args public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        List<Integer> list = new ArrayList<>();

        if(str.length() == 1) {
            System.out.println(0);
        } else {
            for(int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            }
            int minCount = list.size();
            for(int i = 0; i < 2; i++) {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            }

            System.out.println(minCount);
        }

    }
} public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        List<Integer> list = new ArrayList<>();

        if(str.length() == 1) {
            System.out.println(0);
        } else {
            for(int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            }
            int minCount = list.size();
            for(int i = 0; i < 2; i++) {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            }

            System.out.println(minCount);
        }

    }
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
 
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        List<Integer> list = new ArrayList<>();

        if(str.length() == 1) {
            System.out.println(0);
        } else {
            for(int i = 0; i < str.length(); i++) {
                char c = str.charAt(i);
                list.add(Character.getNumericValue(c));
            }
            int minCount = list.size();
            for(int i = 0; i < 2; i++) {
                int count = 0;
                for(int j = 0; j < list.size(); j++) {
                    if(j % 2 == 0 && list.get(j) != i) count++;
                    if(j % 2 == 1 && list.get(j) == i) count++;
                }
                if(minCount >= count) minCount = count;
            }

            System.out.println(minCount);
        }

    }
}