import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        char[] ar = new char[N];
        char[] br = new char[N];
        int a = 0;
        int b = 0;
        for (int i = 0; i < N; i++) {
            ar[i] = i % 2 == 0 ? '0' : '1'; 
            br[i] = i % 2 == 0 ? '1' : '0';
        }
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            }
        }
        
        out.println(Math.min(a, b));
        
        out.flush();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        char[] ar = new char[N];
        char[] br = new char[N];
        int a = 0;
        int b = 0;
        for (int i = 0; i < N; i++) {
            ar[i] = i % 2 == 0 ? '0' : '1'; 
            br[i] = i % 2 == 0 ? '1' : '0';
        }
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            }
        }
        
        out.println(Math.min(a, b));
        
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        char[] ar = new char[N];
        char[] br = new char[N];
        int a = 0;
        int b = 0;
        for (int i = 0; i < N; i++) {
            ar[i] = i % 2 == 0 ? '0' : '1'; 
            br[i] = i % 2 == 0 ? '1' : '0';
        }
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            }
        }
        
        out.println(Math.min(a, b));
        
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        char[] ar = new char[N];
        char[] br = new char[N];
        int a = 0;
        int b = 0;
        for (int i = 0; i < N; i++) {
            ar[i] = i % 2 == 0 ? '0' : '1'; 
            br[i] = i % 2 == 0 ? '1' : '0';
        }
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            }
        }
        
        out.println(Math.min(a, b));
        
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) char[] ch = sc.next().toCharArray(); ch sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc final int N = ch.length; N ch.length ch ch.length char[] ar = new char[N]; ar new char[N] N char[] br = new char[N]; br new char[N] N int a = 0; a 0 int b = 0; b 0 for (int i = 0; i < N; i++) {
            ar[i] = i % 2 == 0 ? '0' : '1'; 
            br[i] = i % 2 == 0 ? '1' : '0';
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            ar[i] = i % 2 == 0 ? '0' : '1'; 
            br[i] = i % 2 == 0 ? '1' : '0';
        } {
            ar[i] = i % 2 == 0 ? '0' : '1'; 
            br[i] = i % 2 == 0 ? '1' : '0';
        } ar[i] = i % 2 == 0 ? '0' : '1' ar[i] ar i i % 2 == 0 ? '0' : '1' i % 2 == 0 i % 2 i 2 0 '0' '1' br[i] = i % 2 == 0 ? '1' : '0' br[i] br i i % 2 == 0 ? '1' : '0' i % 2 == 0 i % 2 i 2 0 '1' '0' for (int i = 0; i < N; i++) {
            if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            }
        } {
            if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            }
        } if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            } ch[i] != ar[i] ch[i] ch i ar[i] ar i {
                a++;
            } a++ a {
                b++;
            } b++ b out.println(Math.min(a, b)) out.println out Math.min(a, b) Math.min Math a b out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        char[] ar = new char[N];
        char[] br = new char[N];
        int a = 0;
        int b = 0;
        for (int i = 0; i < N; i++) {
            ar[i] = i % 2 == 0 ? '0' : '1'; 
            br[i] = i % 2 == 0 ? '1' : '0';
        }
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            }
        }
        
        out.println(Math.min(a, b));
        
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        char[] ar = new char[N];
        char[] br = new char[N];
        int a = 0;
        int b = 0;
        for (int i = 0; i < N; i++) {
            ar[i] = i % 2 == 0 ? '0' : '1'; 
            br[i] = i % 2 == 0 ? '1' : '0';
        }
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            }
        }
        
        out.println(Math.min(a, b));
        
        out.flush();
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        char[] ch = sc.next().toCharArray();
        final int N = ch.length;
        char[] ar = new char[N];
        char[] br = new char[N];
        int a = 0;
        int b = 0;
        for (int i = 0; i < N; i++) {
            ar[i] = i % 2 == 0 ? '0' : '1'; 
            br[i] = i % 2 == 0 ? '1' : '0';
        }
        
        for (int i = 0; i < N; i++) {
            if (ch[i] != ar[i]) {
                a++;
            } else {
                b++;
            }
        }
        
        out.println(Math.min(a, b));
        
        out.flush();
    }
}