import java.util.Scanner;

public class Main {
    private static final int ZERO = 48;

    public static String process(String S) {

        int diffStartWithZero = diffStartsWith(0, S);
        int diffStartWithOne = diffStartsWith(1, S);

        return String.valueOf(Math.min(diffStartWithZero, diffStartWithOne));
    }

    private static int diffStartsWith(int start, String S) {
        int diff = 0;
        for (int i = 0, length = S.length(); i < length; ++i) {
            if (S.codePointAt(i) - ZERO != start) {
                diff++;
            }
            start = (start + 1) % 2;
        }

        return diff;
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        final String result = process(S);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    private static final int ZERO = 48;

    public static String process(String S) {

        int diffStartWithZero = diffStartsWith(0, S);
        int diffStartWithOne = diffStartsWith(1, S);

        return String.valueOf(Math.min(diffStartWithZero, diffStartWithOne));
    }

    private static int diffStartsWith(int start, String S) {
        int diff = 0;
        for (int i = 0, length = S.length(); i < length; ++i) {
            if (S.codePointAt(i) - ZERO != start) {
                diff++;
            }
            start = (start + 1) % 2;
        }

        return diff;
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        final String result = process(S);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
} Main private static final int ZERO = 48; ZERO 48 public static String process(String S) {

        int diffStartWithZero = diffStartsWith(0, S);
        int diffStartWithOne = diffStartsWith(1, S);

        return String.valueOf(Math.min(diffStartWithZero, diffStartWithOne));
    } process {

        int diffStartWithZero = diffStartsWith(0, S);
        int diffStartWithOne = diffStartsWith(1, S);

        return String.valueOf(Math.min(diffStartWithZero, diffStartWithOne));
    } int diffStartWithZero = diffStartsWith(0, S); diffStartWithZero diffStartsWith(0, S) diffStartsWith 0 S int diffStartWithOne = diffStartsWith(1, S); diffStartWithOne diffStartsWith(1, S) diffStartsWith 1 S return String.valueOf(Math.min(diffStartWithZero, diffStartWithOne)); String.valueOf(Math.min(diffStartWithZero, diffStartWithOne)) String.valueOf String Math.min(diffStartWithZero, diffStartWithOne) Math.min Math diffStartWithZero diffStartWithOne String S S private static int diffStartsWith(int start, String S) {
        int diff = 0;
        for (int i = 0, length = S.length(); i < length; ++i) {
            if (S.codePointAt(i) - ZERO != start) {
                diff++;
            }
            start = (start + 1) % 2;
        }

        return diff;
    } diffStartsWith {
        int diff = 0;
        for (int i = 0, length = S.length(); i < length; ++i) {
            if (S.codePointAt(i) - ZERO != start) {
                diff++;
            }
            start = (start + 1) % 2;
        }

        return diff;
    } int diff = 0; diff 0 for (int i = 0, length = S.length(); i < length; ++i) {
            if (S.codePointAt(i) - ZERO != start) {
                diff++;
            }
            start = (start + 1) % 2;
        } int i = 0, length = S.length(); int i = 0 i 0 length = S.length(); length S.length() S.length S i < length i length ++i ++i i {
            if (S.codePointAt(i) - ZERO != start) {
                diff++;
            }
            start = (start + 1) % 2;
        } {
            if (S.codePointAt(i) - ZERO != start) {
                diff++;
            }
            start = (start + 1) % 2;
        } if (S.codePointAt(i) - ZERO != start) {
                diff++;
            } S.codePointAt(i) - ZERO != start S.codePointAt(i) - ZERO S.codePointAt(i) S.codePointAt S i ZERO start {
                diff++;
            } diff++ diff start = (start + 1) % 2 start (start + 1) % 2 (start + 1) start 1 2 return diff; diff int start start String S S public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        final String result = process(S);

        output(result);
    } main {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        final String result = process(S);

        output(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc final String result = process(S); result process(S) process S output(result) output result String[] args args private static void output(String result) {
        System.out.println(result);
    } output {
        System.out.println(result);
    } System.out.println(result) System.out.println System.out System System.out result String result result public class Main {
    private static final int ZERO = 48;

    public static String process(String S) {

        int diffStartWithZero = diffStartsWith(0, S);
        int diffStartWithOne = diffStartsWith(1, S);

        return String.valueOf(Math.min(diffStartWithZero, diffStartWithOne));
    }

    private static int diffStartsWith(int start, String S) {
        int diff = 0;
        for (int i = 0, length = S.length(); i < length; ++i) {
            if (S.codePointAt(i) - ZERO != start) {
                diff++;
            }
            start = (start + 1) % 2;
        }

        return diff;
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        final String result = process(S);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
} public class Main {
    private static final int ZERO = 48;

    public static String process(String S) {

        int diffStartWithZero = diffStartsWith(0, S);
        int diffStartWithOne = diffStartsWith(1, S);

        return String.valueOf(Math.min(diffStartWithZero, diffStartWithOne));
    }

    private static int diffStartsWith(int start, String S) {
        int diff = 0;
        for (int i = 0, length = S.length(); i < length; ++i) {
            if (S.codePointAt(i) - ZERO != start) {
                diff++;
            }
            start = (start + 1) % 2;
        }

        return diff;
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        final String result = process(S);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
} Main
import java.util.Scanner;

public class Main {
    private static final int ZERO = 48;

    public static String process(String S) {

        int diffStartWithZero = diffStartsWith(0, S);
        int diffStartWithOne = diffStartsWith(1, S);

        return String.valueOf(Math.min(diffStartWithZero, diffStartWithOne));
    }

    private static int diffStartsWith(int start, String S) {
        int diff = 0;
        for (int i = 0, length = S.length(); i < length; ++i) {
            if (S.codePointAt(i) - ZERO != start) {
                diff++;
            }
            start = (start + 1) % 2;
        }

        return diff;
    }

    // Util func

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        final String result = process(S);

        output(result);
    }

    private static void output(String result) {
        System.out.println(result);
    }
}
