import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] w = sc.next().toCharArray();
        int n = w.length;
        int s0 = 0;
        int s1 = 0;
        for(int i = 0; i < n; i++){
            if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            }
        }
        System.out.println(Math.min(s0,s1));
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] w = sc.next().toCharArray();
        int n = w.length;
        int s0 = 0;
        int s1 = 0;
        for(int i = 0; i < n; i++){
            if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            }
        }
        System.out.println(Math.min(s0,s1));
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] w = sc.next().toCharArray();
        int n = w.length;
        int s0 = 0;
        int s1 = 0;
        for(int i = 0; i < n; i++){
            if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            }
        }
        System.out.println(Math.min(s0,s1));
    } main {
        Scanner sc = new Scanner(System.in);
        char[] w = sc.next().toCharArray();
        int n = w.length;
        int s0 = 0;
        int s1 = 0;
        for(int i = 0; i < n; i++){
            if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            }
        }
        System.out.println(Math.min(s0,s1));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] w = sc.next().toCharArray(); w sc.next().toCharArray() sc.next().toCharArray sc.next() sc.next sc int n = w.length; n w.length w w.length int s0 = 0; s0 0 int s1 = 0; s1 0 for(int i = 0; i < n; i++){
            if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            }
        } {
            if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            }
        } if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            } i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0' i % 2 == 0 && w[i] == '1' i % 2 == 0 i % 2 i 2 0 w[i] == '1' w[i] w i '1' i % 2 != 0 && w[i] == '0' i % 2 != 0 i % 2 i 2 0 w[i] == '0' w[i] w i '0' {
                s0++;
            } s0++ s0 for(int i = 0; i < n; i++){
            if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            }
        } {
            if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            }
        } if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            } i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0' i % 2 != 0 && w[i] == '1' i % 2 != 0 i % 2 i 2 0 w[i] == '1' w[i] w i '1' i % 2 == 0 && w[i] == '0' i % 2 == 0 i % 2 i 2 0 w[i] == '0' w[i] w i '0' {
                s1++;
            } s1++ s1 System.out.println(Math.min(s0,s1)) System.out.println System.out System System.out Math.min(s0,s1) Math.min Math s0 s1 String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] w = sc.next().toCharArray();
        int n = w.length;
        int s0 = 0;
        int s1 = 0;
        for(int i = 0; i < n; i++){
            if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            }
        }
        System.out.println(Math.min(s0,s1));
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] w = sc.next().toCharArray();
        int n = w.length;
        int s0 = 0;
        int s1 = 0;
        for(int i = 0; i < n; i++){
            if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            }
        }
        System.out.println(Math.min(s0,s1));
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        char[] w = sc.next().toCharArray();
        int n = w.length;
        int s0 = 0;
        int s1 = 0;
        for(int i = 0; i < n; i++){
            if(i % 2 == 0 && w[i] == '1' || i % 2 != 0 && w[i] == '0'){
                s0++;
            }
        }
        for(int i = 0; i < n; i++){
            if(i % 2 != 0 && w[i] == '1' || i % 2 == 0 && w[i] == '0'){
                s1++;
            }
        }
        System.out.println(Math.min(s0,s1));
    }
}
