import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        String sp = "01";

        Long count_s1 = 0L;
        Long count_s2 = 0L;
        for (int i = 0; i < s.length(); i++) {
            if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            }
        }

        Long min = Math.min(count_s1, count_s2);
        System.out.println(min);
    }
} 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();
        String sp = "01";

        Long count_s1 = 0L;
        Long count_s2 = 0L;
        for (int i = 0; i < s.length(); i++) {
            if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            }
        }

        Long min = Math.min(count_s1, count_s2);
        System.out.println(min);
    }
} Main public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        String sp = "01";

        Long count_s1 = 0L;
        Long count_s2 = 0L;
        for (int i = 0; i < s.length(); i++) {
            if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            }
        }

        Long min = Math.min(count_s1, count_s2);
        System.out.println(min);
    } main {
        //コード
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        String sp = "01";

        Long count_s1 = 0L;
        Long count_s2 = 0L;
        for (int i = 0; i < s.length(); i++) {
            if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            }
        }

        Long min = Math.min(count_s1, count_s2);
        System.out.println(min);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.next(); s scanner.next() scanner.next scanner String sp = "01"; sp "01" Long count_s1 = 0L; count_s1 0L Long count_s2 = 0L; count_s2 0L for (int i = 0; i < s.length(); i++) {
            if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            }
        } {
            if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            }
        } if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            } i%2 ==0 i%2 i 2 0 {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            } if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                } s.charAt(i) == sp.charAt(0) s.charAt(i) s.charAt s i sp.charAt(0) sp.charAt sp 0 {
                    count_s1++;
                } count_s1++ count_s1 {
                    count_s2++;
                } count_s2++ count_s2 {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            } if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                } s.charAt(i) == sp.charAt(1) s.charAt(i) s.charAt s i sp.charAt(1) sp.charAt sp 1 {
                    count_s1++;
                } count_s1++ count_s1 {
                    count_s2++;
                } count_s2++ count_s2 Long min = Math.min(count_s1, count_s2); min Math.min(count_s1, count_s2) Math.min Math count_s1 count_s2 System.out.println(min) System.out.println System.out System System.out min String[] args args public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        String sp = "01";

        Long count_s1 = 0L;
        Long count_s2 = 0L;
        for (int i = 0; i < s.length(); i++) {
            if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            }
        }

        Long min = Math.min(count_s1, count_s2);
        System.out.println(min);
    }
} public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        String sp = "01";

        Long count_s1 = 0L;
        Long count_s2 = 0L;
        for (int i = 0; i < s.length(); i++) {
            if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            }
        }

        Long min = Math.min(count_s1, count_s2);
        System.out.println(min);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        //コード
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        String sp = "01";

        Long count_s1 = 0L;
        Long count_s2 = 0L;
        for (int i = 0; i < s.length(); i++) {
            if(i%2 ==0) {
                if (s.charAt(i) == sp.charAt(0)) {
                    count_s1++;
                } else {
                    count_s2++;
                }
            }else {
                if (s.charAt(i) == sp.charAt(1)) {
                    count_s1++;
                } else {
                    count_s2++;
                }

            }
        }

        Long min = Math.min(count_s1, count_s2);
        System.out.println(min);
    }
}
