import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        
        int count = 0;
        for(int i = 0; i < s.length(); i++){
            if(i % 2 == 0){
                if(s.charAt(i) == '0'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            }
        }
        
        if(count > (s.length() / 2)){
            count = s.length() - count;
        }
        
        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        
        int count = 0;
        for(int i = 0; i < s.length(); i++){
            if(i % 2 == 0){
                if(s.charAt(i) == '0'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            }
        }
        
        if(count > (s.length() / 2)){
            count = s.length() - count;
        }
        
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        
        int count = 0;
        for(int i = 0; i < s.length(); i++){
            if(i % 2 == 0){
                if(s.charAt(i) == '0'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            }
        }
        
        if(count > (s.length() / 2)){
            count = s.length() - count;
        }
        
        System.out.println(count);
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        
        int count = 0;
        for(int i = 0; i < s.length(); i++){
            if(i % 2 == 0){
                if(s.charAt(i) == '0'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            }
        }
        
        if(count > (s.length() / 2)){
            count = s.length() - count;
        }
        
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc int count = 0; count 0 for(int i = 0; i < s.length(); i++){
            if(i % 2 == 0){
                if(s.charAt(i) == '0'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            }
        } 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'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            }
        } {
            if(i % 2 == 0){
                if(s.charAt(i) == '0'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            }
        } if(i % 2 == 0){
                if(s.charAt(i) == '0'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            } i % 2 == 0 i % 2 i 2 0 {
                if(s.charAt(i) == '0'){
                    count++;
                }
            } if(s.charAt(i) == '0'){
                    count++;
                } s.charAt(i) == '0' s.charAt(i) s.charAt s i '0' {
                    count++;
                } count++ count {
                if(s.charAt(i) == '1'){
                    count++;
                }
            } if(s.charAt(i) == '1'){
                    count++;
                } s.charAt(i) == '1' s.charAt(i) s.charAt s i '1' {
                    count++;
                } count++ count if(count > (s.length() / 2)){
            count = s.length() - count;
        } count > (s.length() / 2) count (s.length() / 2) s.length() s.length s 2 {
            count = s.length() - count;
        } count = s.length() - count count s.length() - count s.length() s.length s count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        
        int count = 0;
        for(int i = 0; i < s.length(); i++){
            if(i % 2 == 0){
                if(s.charAt(i) == '0'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            }
        }
        
        if(count > (s.length() / 2)){
            count = s.length() - count;
        }
        
        System.out.println(count);
    }
} public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        
        int count = 0;
        for(int i = 0; i < s.length(); i++){
            if(i % 2 == 0){
                if(s.charAt(i) == '0'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            }
        }
        
        if(count > (s.length() / 2)){
            count = s.length() - count;
        }
        
        System.out.println(count);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        
        int count = 0;
        for(int i = 0; i < s.length(); i++){
            if(i % 2 == 0){
                if(s.charAt(i) == '0'){
                    count++;
                }
            }else{
                if(s.charAt(i) == '1'){
                    count++;
                }
            }
        }
        
        if(count > (s.length() / 2)){
            count = s.length() - count;
        }
        
        System.out.println(count);
    }
}