import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    // 10:33-
    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            String s = sc.next();
            out.println(Math.min(c(s, 0), c(s, 1)));
        }
    }

    private static int c(String s, int x) {
        int cost = 0;
        for (int i = 0; i < s.length(); i++) {
            if ((s.charAt(i) - '0') != x) cost++;
            x = 1 - x;
        }
        return cost;
    }
} import java.io.BufferedInputStream; BufferedInputStream java.io import java.io.BufferedOutputStream; BufferedOutputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Scanner; Scanner java.util public class Main {

    // 10:33-
    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            String s = sc.next();
            out.println(Math.min(c(s, 0), c(s, 1)));
        }
    }

    private static int c(String s, int x) {
        int cost = 0;
        for (int i = 0; i < s.length(); i++) {
            if ((s.charAt(i) - '0') != x) cost++;
            x = 1 - x;
        }
        return cost;
    }
} Main // 10:33-
    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            String s = sc.next();
            out.println(Math.min(c(s, 0), c(s, 1)));
        }
    } main {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            String s = sc.next();
            out.println(Math.min(c(s, 0), c(s, 1)));
        }
    } try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            String s = sc.next();
            out.println(Math.min(c(s, 0), c(s, 1)));
        } {

            Scanner sc = new Scanner(in);

            String s = sc.next();
            out.println(Math.min(c(s, 0), c(s, 1)));
        } BufferedInputStream in = new BufferedInputStream(System.in) BufferedInputStream in = new BufferedInputStream(System.in) new BufferedInputStream(System.in) PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)) PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)) new PrintWriter(new BufferedOutputStream(System.out)) Scanner sc = new Scanner(in); sc new Scanner(in) String s = sc.next(); s sc.next() sc.next sc out.println(Math.min(c(s, 0), c(s, 1))) out.println out Math.min(c(s, 0), c(s, 1)) Math.min Math c(s, 0) c s 0 c(s, 1) c s 1 String[] args args private static int c(String s, int x) {
        int cost = 0;
        for (int i = 0; i < s.length(); i++) {
            if ((s.charAt(i) - '0') != x) cost++;
            x = 1 - x;
        }
        return cost;
    } c {
        int cost = 0;
        for (int i = 0; i < s.length(); i++) {
            if ((s.charAt(i) - '0') != x) cost++;
            x = 1 - x;
        }
        return cost;
    } int cost = 0; cost 0 for (int i = 0; i < s.length(); i++) {
            if ((s.charAt(i) - '0') != x) cost++;
            x = 1 - x;
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if ((s.charAt(i) - '0') != x) cost++;
            x = 1 - x;
        } {
            if ((s.charAt(i) - '0') != x) cost++;
            x = 1 - x;
        } if ((s.charAt(i) - '0') != x) cost++; (s.charAt(i) - '0') != x (s.charAt(i) - '0') s.charAt(i) s.charAt s i '0' x cost++ cost x = 1 - x x 1 - x 1 x return cost; cost String s s int x x public class Main {

    // 10:33-
    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            String s = sc.next();
            out.println(Math.min(c(s, 0), c(s, 1)));
        }
    }

    private static int c(String s, int x) {
        int cost = 0;
        for (int i = 0; i < s.length(); i++) {
            if ((s.charAt(i) - '0') != x) cost++;
            x = 1 - x;
        }
        return cost;
    }
} public class Main {

    // 10:33-
    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            String s = sc.next();
            out.println(Math.min(c(s, 0), c(s, 1)));
        }
    }

    private static int c(String s, int x) {
        int cost = 0;
        for (int i = 0; i < s.length(); i++) {
            if ((s.charAt(i) - '0') != x) cost++;
            x = 1 - x;
        }
        return cost;
    }
} Main
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    // 10:33-
    public static void main(String[] args) throws Exception {
        try (BufferedInputStream in = new BufferedInputStream(System.in);
             PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out))) {

            Scanner sc = new Scanner(in);

            String s = sc.next();
            out.println(Math.min(c(s, 0), c(s, 1)));
        }
    }

    private static int c(String s, int x) {
        int cost = 0;
        for (int i = 0; i < s.length(); i++) {
            if ((s.charAt(i) - '0') != x) cost++;
            x = 1 - x;
        }
        return cost;
    }
}
