import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            }
            if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            }
            if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            }
            if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    } main {

        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            }
            if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.next(); S sc.next() sc.next sc int forward = 0; forward 0 int backward = 0; backward 0 for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            }
            if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            }
            if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            }
        } {
            if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            }
            if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            }
        } if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            } S.charAt(i) == (48 + i % 2 ) S.charAt(i) S.charAt S i (48 + i % 2 ) 48 i % 2 i 2 {
                forward++;
            } forward++ forward if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            } S.charAt(i) != (48 + i % 2) S.charAt(i) S.charAt S i (48 + i % 2) 48 i % 2 i 2 {
                backward++;
            } backward++ backward System.out.println(Math.min(forward, backward)) System.out.println System.out System System.out Math.min(forward, backward) Math.min Math forward backward String[] args args public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            }
            if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    }
} public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            }
            if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        String S = sc.next();

        int forward = 0;
        int backward = 0;

        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == (48 + i % 2 )) {
                forward++;
            }
            if (S.charAt(i) != (48 + i % 2)) {
                backward++;
            }
        }

        System.out.println(Math.min(forward, backward));
    }
}
