import java.io.*;
import java.lang.*;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
import java.math.BigInteger;

public class Main {
    static InputReader in = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = in.next();
        char[] arr = s.toCharArray();
        char[] v1 = new char[s.length()];
        char[] v2 = new char[s.length()];
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            }
        }
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            }
        }
        int c1 = 0;
        int c2 = 0;
        for(int i = 0; i<s.length(); i++){
            if(arr[i]!=v1[i]){
                ++c1;
            }
            if(arr[i]!=v2[i]){
                ++c2;
            }
        }
        out.println(Math.min(c1,c2));
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public boolean hasNext() {
            String next = null;
            try {
                next = reader.readLine();
            } catch (Exception e) {
            }
            if (next == null) {
                return false;
            }
            tokenizer = new StringTokenizer(next);
            return true;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
    }
}
 import java.io.*; io.* java import java.lang.*; lang.* java import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.BufferedReader; BufferedReader java.io import java.io.OutputStream; OutputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.io.IOException; IOException java.io import java.util.StringTokenizer; StringTokenizer java.util import java.math.BigInteger; BigInteger java.math public class Main {
    static InputReader in = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = in.next();
        char[] arr = s.toCharArray();
        char[] v1 = new char[s.length()];
        char[] v2 = new char[s.length()];
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            }
        }
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            }
        }
        int c1 = 0;
        int c2 = 0;
        for(int i = 0; i<s.length(); i++){
            if(arr[i]!=v1[i]){
                ++c1;
            }
            if(arr[i]!=v2[i]){
                ++c2;
            }
        }
        out.println(Math.min(c1,c2));
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public boolean hasNext() {
            String next = null;
            try {
                next = reader.readLine();
            } catch (Exception e) {
            }
            if (next == null) {
                return false;
            }
            tokenizer = new StringTokenizer(next);
            return true;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
    }
} Main static InputReader in = new InputReader(System.in); in new InputReader(System.in) static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] args) {
        String s = in.next();
        char[] arr = s.toCharArray();
        char[] v1 = new char[s.length()];
        char[] v2 = new char[s.length()];
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            }
        }
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            }
        }
        int c1 = 0;
        int c2 = 0;
        for(int i = 0; i<s.length(); i++){
            if(arr[i]!=v1[i]){
                ++c1;
            }
            if(arr[i]!=v2[i]){
                ++c2;
            }
        }
        out.println(Math.min(c1,c2));
        out.close();
    } main {
        String s = in.next();
        char[] arr = s.toCharArray();
        char[] v1 = new char[s.length()];
        char[] v2 = new char[s.length()];
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            }
        }
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            }
        }
        int c1 = 0;
        int c2 = 0;
        for(int i = 0; i<s.length(); i++){
            if(arr[i]!=v1[i]){
                ++c1;
            }
            if(arr[i]!=v2[i]){
                ++c2;
            }
        }
        out.println(Math.min(c1,c2));
        out.close();
    } String s = in.next(); s in.next() in.next in char[] arr = s.toCharArray(); arr s.toCharArray() s.toCharArray s char[] v1 = new char[s.length()]; v1 new char[s.length()] s.length() s.length s char[] v2 = new char[s.length()]; v2 new char[s.length()] s.length() s.length s for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            }
        } int i = 0; int i = 0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
            if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            }
        } {
            if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            }
        } if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            } i%2==0 i%2 i 2 0 {
                v1[i] = '1';
            } v1[i] = '1' v1[i] v1 i '1' {
                v1[i] = '0';
            } v1[i] = '0' v1[i] v1 i '0' for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            }
        } int i = 0; int i = 0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
            if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            }
        } {
            if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            }
        } if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            } i%2==0 i%2 i 2 0 {
                v2[i] = '0';
            } v2[i] = '0' v2[i] v2 i '0' {
                v2[i] = '1';
            } v2[i] = '1' v2[i] v2 i '1' int c1 = 0; c1 0 int c2 = 0; c2 0 for(int i = 0; i<s.length(); i++){
            if(arr[i]!=v1[i]){
                ++c1;
            }
            if(arr[i]!=v2[i]){
                ++c2;
            }
        } int i = 0; int i = 0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
            if(arr[i]!=v1[i]){
                ++c1;
            }
            if(arr[i]!=v2[i]){
                ++c2;
            }
        } {
            if(arr[i]!=v1[i]){
                ++c1;
            }
            if(arr[i]!=v2[i]){
                ++c2;
            }
        } if(arr[i]!=v1[i]){
                ++c1;
            } arr[i]!=v1[i] arr[i] arr i v1[i] v1 i {
                ++c1;
            } ++c1 c1 if(arr[i]!=v2[i]){
                ++c2;
            } arr[i]!=v2[i] arr[i] arr i v2[i] v2 i {
                ++c2;
            } ++c2 c2 out.println(Math.min(c1,c2)) out.println out Math.min(c1,c2) Math.min Math c1 c2 out.close() out.close out String[] args args static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public boolean hasNext() {
            String next = null;
            try {
                next = reader.readLine();
            } catch (Exception e) {
            }
            if (next == null) {
                return false;
            }
            tokenizer = new StringTokenizer(next);
            return true;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
    } InputReader public BufferedReader reader; reader public StringTokenizer tokenizer; tokenizer public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        } InputReader {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        } reader = new BufferedReader(new InputStreamReader(stream), 32768) reader new BufferedReader(new InputStreamReader(stream), 32768) tokenizer = null tokenizer null InputStream stream stream public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } next {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    tokenizer = new StringTokenizer(reader.readLine());
                } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public double nextDouble() {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public String nextLine() {
            try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        } nextLine {
            try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        } try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            } catch (Exception e) {
                e.printStackTrace();
            } Exception e {
                e.printStackTrace();
            } e.printStackTrace() e.printStackTrace e {
                return reader.readLine();
            } return reader.readLine(); reader.readLine() reader.readLine reader return null; null public boolean hasNext() {
            String next = null;
            try {
                next = reader.readLine();
            } catch (Exception e) {
            }
            if (next == null) {
                return false;
            }
            tokenizer = new StringTokenizer(next);
            return true;
        } hasNext {
            String next = null;
            try {
                next = reader.readLine();
            } catch (Exception e) {
            }
            if (next == null) {
                return false;
            }
            tokenizer = new StringTokenizer(next);
            return true;
        } String next = null; next null try {
                next = reader.readLine();
            } catch (Exception e) {
            } catch (Exception e) {
            } Exception e {
            } {
                next = reader.readLine();
            } next = reader.readLine() next reader.readLine() reader.readLine reader if (next == null) {
                return false;
            } next == null next null {
                return false;
            } return false; false tokenizer = new StringTokenizer(next) tokenizer new StringTokenizer(next) return true; true public BigInteger nextBigInteger() {
            return new BigInteger(next());
        } nextBigInteger {
            return new BigInteger(next());
        } return new BigInteger(next()); new BigInteger(next()) public class Main {
    static InputReader in = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = in.next();
        char[] arr = s.toCharArray();
        char[] v1 = new char[s.length()];
        char[] v2 = new char[s.length()];
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            }
        }
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            }
        }
        int c1 = 0;
        int c2 = 0;
        for(int i = 0; i<s.length(); i++){
            if(arr[i]!=v1[i]){
                ++c1;
            }
            if(arr[i]!=v2[i]){
                ++c2;
            }
        }
        out.println(Math.min(c1,c2));
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public boolean hasNext() {
            String next = null;
            try {
                next = reader.readLine();
            } catch (Exception e) {
            }
            if (next == null) {
                return false;
            }
            tokenizer = new StringTokenizer(next);
            return true;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
    }
} public class Main {
    static InputReader in = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = in.next();
        char[] arr = s.toCharArray();
        char[] v1 = new char[s.length()];
        char[] v2 = new char[s.length()];
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            }
        }
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            }
        }
        int c1 = 0;
        int c2 = 0;
        for(int i = 0; i<s.length(); i++){
            if(arr[i]!=v1[i]){
                ++c1;
            }
            if(arr[i]!=v2[i]){
                ++c2;
            }
        }
        out.println(Math.min(c1,c2));
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public boolean hasNext() {
            String next = null;
            try {
                next = reader.readLine();
            } catch (Exception e) {
            }
            if (next == null) {
                return false;
            }
            tokenizer = new StringTokenizer(next);
            return true;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
    }
} Main
import java.io.*;
import java.lang.*;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.StringTokenizer;
import java.math.BigInteger;

public class Main {
    static InputReader in = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        String s = in.next();
        char[] arr = s.toCharArray();
        char[] v1 = new char[s.length()];
        char[] v2 = new char[s.length()];
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v1[i] = '1';
            }
            else{
                v1[i] = '0';
            }
        }
        for(int i = 0; i<s.length(); i++){
            if(i%2==0){
                v2[i] = '0';
            }
            else{
                v2[i] = '1';
            }
        }
        int c1 = 0;
        int c2 = 0;
        for(int i = 0; i<s.length(); i++){
            if(arr[i]!=v1[i]){
                ++c1;
            }
            if(arr[i]!=v2[i]){
                ++c2;
            }
        }
        out.println(Math.min(c1,c2));
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            return null;
        }

        public boolean hasNext() {
            String next = null;
            try {
                next = reader.readLine();
            } catch (Exception e) {
            }
            if (next == null) {
                return false;
            }
            tokenizer = new StringTokenizer(next);
            return true;
        }

        public BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
    }
}

