import java.util.*;
import java.io.InputStreamReader;
import java.io.BufferedReader;


public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            }
        }
        
        int count2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            }
        }
        
        //System.out.println(count2);
        System.out.println(Math.min(count1, count2));
    }
}


 import java.util.*; util.* java import java.io.InputStreamReader; InputStreamReader java.io import java.io.BufferedReader; BufferedReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            }
        }
        
        int count2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            }
        }
        
        //System.out.println(count2);
        System.out.println(Math.min(count1, count2));
    }
} Main public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            }
        }
        
        int count2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            }
        }
        
        //System.out.println(count2);
        System.out.println(Math.min(count1, count2));
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            }
        }
        
        int count2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            }
        }
        
        //System.out.println(count2);
        System.out.println(Math.min(count1, count2));
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String s = br.readLine(); s br.readLine() br.readLine br int count1 = 0; count1 0 for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            }
        } {
            if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            }
        } if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            } i % 2 == 0 i % 2 i 2 0 {
                if (s.charAt(i) != '0') count1++;
            } if (s.charAt(i) != '0') count1++; s.charAt(i) != '0' s.charAt(i) s.charAt s i '0' count1++ count1 {
                if (s.charAt(i) != '1') count1++;
            } if (s.charAt(i) != '1') count1++; s.charAt(i) != '1' s.charAt(i) s.charAt s i '1' count1++ count1 int count2 = 0; count2 0 for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            }
        } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            }
        } {
            if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            }
        } if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            } i % 2 == 0 i % 2 i 2 0 {
                if (s.charAt(i) != '1') count2++;
            } if (s.charAt(i) != '1') count2++; s.charAt(i) != '1' s.charAt(i) s.charAt s i '1' count2++ count2 {
                if (s.charAt(i) != '0') count2++;
            } if (s.charAt(i) != '0') count2++; s.charAt(i) != '0' s.charAt(i) s.charAt s i '0' count2++ count2 System.out.println(Math.min(count1, count2)) System.out.println System.out System System.out Math.min(count1, count2) Math.min Math count1 count2 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            }
        }
        
        int count2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            }
        }
        
        //System.out.println(count2);
        System.out.println(Math.min(count1, count2));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            }
        }
        
        int count2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            }
        }
        
        //System.out.println(count2);
        System.out.println(Math.min(count1, count2));
    }
} Main
import java.util.*;
import java.io.InputStreamReader;
import java.io.BufferedReader;


public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String s = br.readLine();
        
        int count1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '0') count1++;
            }
            else {
                if (s.charAt(i) != '1') count1++;
            }
        }
        
        int count2 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (i % 2 == 0) {
                if (s.charAt(i) != '1') count2++;
            }
            else {
                if (s.charAt(i) != '0') count2++;
            }
        }
        
        //System.out.println(count2);
        System.out.println(Math.min(count1, count2));
    }
}



