import java.util.Scanner;

/**
 * Created by dezhonger on 2019/4/13
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] c = new char[]{'0', '1'};
        int cc = 0;
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count1++;
            }
            cc = 1 - cc;
        }

        int count2 = 0;
        cc = 1;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count2++;
            }
            cc = 1 - cc;
        }
        System.out.println(Math.min(count1, count2));

    }
} 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.nextLine();
        char[] c = new char[]{'0', '1'};
        int cc = 0;
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count1++;
            }
            cc = 1 - cc;
        }

        int count2 = 0;
        cc = 1;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count2++;
            }
            cc = 1 - cc;
        }
        System.out.println(Math.min(count1, count2));

    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] c = new char[]{'0', '1'};
        int cc = 0;
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count1++;
            }
            cc = 1 - cc;
        }

        int count2 = 0;
        cc = 1;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count2++;
            }
            cc = 1 - cc;
        }
        System.out.println(Math.min(count1, count2));

    } main {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] c = new char[]{'0', '1'};
        int cc = 0;
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count1++;
            }
            cc = 1 - cc;
        }

        int count2 = 0;
        cc = 1;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count2++;
            }
            cc = 1 - cc;
        }
        System.out.println(Math.min(count1, count2));

    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String s = scanner.nextLine(); s scanner.nextLine() scanner.nextLine scanner char[] c = new char[]{'0', '1'}; c new char[]{'0', '1'} int cc = 0; cc 0 int count1 = 0; count1 0 for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count1++;
            }
            cc = 1 - cc;
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (s.charAt(i) != c[cc]) {
                count1++;
            }
            cc = 1 - cc;
        } {
            if (s.charAt(i) != c[cc]) {
                count1++;
            }
            cc = 1 - cc;
        } if (s.charAt(i) != c[cc]) {
                count1++;
            } s.charAt(i) != c[cc] s.charAt(i) s.charAt s i c[cc] c cc {
                count1++;
            } count1++ count1 cc = 1 - cc cc 1 - cc 1 cc int count2 = 0; count2 0 cc = 1 cc 1 for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count2++;
            }
            cc = 1 - cc;
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (s.charAt(i) != c[cc]) {
                count2++;
            }
            cc = 1 - cc;
        } {
            if (s.charAt(i) != c[cc]) {
                count2++;
            }
            cc = 1 - cc;
        } if (s.charAt(i) != c[cc]) {
                count2++;
            } s.charAt(i) != c[cc] s.charAt(i) s.charAt s i c[cc] c cc {
                count2++;
            } count2++ count2 cc = 1 - cc cc 1 - cc 1 cc System.out.println(Math.min(count1, count2)) System.out.println System.out System System.out Math.min(count1, count2) Math.min Math count1 count2 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] c = new char[]{'0', '1'};
        int cc = 0;
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count1++;
            }
            cc = 1 - cc;
        }

        int count2 = 0;
        cc = 1;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count2++;
            }
            cc = 1 - cc;
        }
        System.out.println(Math.min(count1, count2));

    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] c = new char[]{'0', '1'};
        int cc = 0;
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count1++;
            }
            cc = 1 - cc;
        }

        int count2 = 0;
        cc = 1;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count2++;
            }
            cc = 1 - cc;
        }
        System.out.println(Math.min(count1, count2));

    }
} Main
import java.util.Scanner;

/**
 * Created by dezhonger on 2019/4/13
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        char[] c = new char[]{'0', '1'};
        int cc = 0;
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count1++;
            }
            cc = 1 - cc;
        }

        int count2 = 0;
        cc = 1;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != c[cc]) {
                count2++;
            }
            cc = 1 - cc;
        }
        System.out.println(Math.min(count1, count2));

    }
}
