import java.util.Scanner;

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

        final StringBuilder cand0Builder = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            cand0Builder.append(i % 2 == 0 ? '0' : '1');
        }

        final String cand0 = cand0Builder.toString();

        int diffCount0 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            }
        }

        System.out.println(Math.min(diffCount0, cand0.length() - diffCount0));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws Exception {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        final StringBuilder cand0Builder = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            cand0Builder.append(i % 2 == 0 ? '0' : '1');
        }

        final String cand0 = cand0Builder.toString();

        int diffCount0 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            }
        }

        System.out.println(Math.min(diffCount0, cand0.length() - diffCount0));
    }
} Main public static void main(String[] args) throws Exception {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        final StringBuilder cand0Builder = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            cand0Builder.append(i % 2 == 0 ? '0' : '1');
        }

        final String cand0 = cand0Builder.toString();

        int diffCount0 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            }
        }

        System.out.println(Math.min(diffCount0, cand0.length() - diffCount0));
    } main {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        final StringBuilder cand0Builder = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            cand0Builder.append(i % 2 == 0 ? '0' : '1');
        }

        final String cand0 = cand0Builder.toString();

        int diffCount0 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            }
        }

        System.out.println(Math.min(diffCount0, cand0.length() - diffCount0));
    } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final String s = scanner.nextLine(); s scanner.nextLine() scanner.nextLine scanner final StringBuilder cand0Builder = new StringBuilder(); cand0Builder new StringBuilder() for (int i = 0; i < s.length(); i++) {
            cand0Builder.append(i % 2 == 0 ? '0' : '1');
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            cand0Builder.append(i % 2 == 0 ? '0' : '1');
        } {
            cand0Builder.append(i % 2 == 0 ? '0' : '1');
        } cand0Builder.append(i % 2 == 0 ? '0' : '1') cand0Builder.append cand0Builder i % 2 == 0 ? '0' : '1' i % 2 == 0 i % 2 i 2 0 '0' '1' final String cand0 = cand0Builder.toString(); cand0 cand0Builder.toString() cand0Builder.toString cand0Builder int diffCount0 = 0; diffCount0 0 for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            }
        } {
            if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            }
        } if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            } s.charAt(i) == cand0.charAt(i) s.charAt(i) s.charAt s i cand0.charAt(i) cand0.charAt cand0 i {
                diffCount0++;
            } diffCount0++ diffCount0 System.out.println(Math.min(diffCount0, cand0.length() - diffCount0)) System.out.println System.out System System.out Math.min(diffCount0, cand0.length() - diffCount0) Math.min Math diffCount0 cand0.length() - diffCount0 cand0.length() cand0.length cand0 diffCount0 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        final StringBuilder cand0Builder = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            cand0Builder.append(i % 2 == 0 ? '0' : '1');
        }

        final String cand0 = cand0Builder.toString();

        int diffCount0 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            }
        }

        System.out.println(Math.min(diffCount0, cand0.length() - diffCount0));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        final Scanner scanner = new Scanner(System.in);
        final String s = scanner.nextLine();

        final StringBuilder cand0Builder = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            cand0Builder.append(i % 2 == 0 ? '0' : '1');
        }

        final String cand0 = cand0Builder.toString();

        int diffCount0 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            }
        }

        System.out.println(Math.min(diffCount0, cand0.length() - diffCount0));
    }
} Main
import java.util.Scanner;

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

        final StringBuilder cand0Builder = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            cand0Builder.append(i % 2 == 0 ? '0' : '1');
        }

        final String cand0 = cand0Builder.toString();

        int diffCount0 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == cand0.charAt(i)) {
                diffCount0++;
            }
        }

        System.out.println(Math.min(diffCount0, cand0.length() - diffCount0));
    }
}
