import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        int a = s.length();
        int[] b = new int[a];
        int[] c = new int[a];
        int[] d = new int[a];
        int bb = a;
        int cc = a;
        for(int i = 0 ; i < a ; i++ ){
            b[i] = i % 2;
            c[i] = (i + 1) % 2;
            d[i] = s.charAt(i) - 48;
            if(b[i] == d[i]){
                bb--;
            }
            if(c[i] == d[i]){
                cc--;
            }
        }
        if(bb > cc){
            System.out.println(cc);
        }else{
            System.out.println(bb);
        }
    }
} 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();
        sc.close();
        int a = s.length();
        int[] b = new int[a];
        int[] c = new int[a];
        int[] d = new int[a];
        int bb = a;
        int cc = a;
        for(int i = 0 ; i < a ; i++ ){
            b[i] = i % 2;
            c[i] = (i + 1) % 2;
            d[i] = s.charAt(i) - 48;
            if(b[i] == d[i]){
                bb--;
            }
            if(c[i] == d[i]){
                cc--;
            }
        }
        if(bb > cc){
            System.out.println(cc);
        }else{
            System.out.println(bb);
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        int a = s.length();
        int[] b = new int[a];
        int[] c = new int[a];
        int[] d = new int[a];
        int bb = a;
        int cc = a;
        for(int i = 0 ; i < a ; i++ ){
            b[i] = i % 2;
            c[i] = (i + 1) % 2;
            d[i] = s.charAt(i) - 48;
            if(b[i] == d[i]){
                bb--;
            }
            if(c[i] == d[i]){
                cc--;
            }
        }
        if(bb > cc){
            System.out.println(cc);
        }else{
            System.out.println(bb);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        int a = s.length();
        int[] b = new int[a];
        int[] c = new int[a];
        int[] d = new int[a];
        int bb = a;
        int cc = a;
        for(int i = 0 ; i < a ; i++ ){
            b[i] = i % 2;
            c[i] = (i + 1) % 2;
            d[i] = s.charAt(i) - 48;
            if(b[i] == d[i]){
                bb--;
            }
            if(c[i] == d[i]){
                cc--;
            }
        }
        if(bb > cc){
            System.out.println(cc);
        }else{
            System.out.println(bb);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc sc.close() sc.close sc int a = s.length(); a s.length() s.length s int[] b = new int[a]; b new int[a] a int[] c = new int[a]; c new int[a] a int[] d = new int[a]; d new int[a] a int bb = a; bb a int cc = a; cc a for(int i = 0 ; i < a ; i++ ){
            b[i] = i % 2;
            c[i] = (i + 1) % 2;
            d[i] = s.charAt(i) - 48;
            if(b[i] == d[i]){
                bb--;
            }
            if(c[i] == d[i]){
                cc--;
            }
        } int i = 0 ; int i = 0 ; i 0 i < a i a i++ i++ i {
            b[i] = i % 2;
            c[i] = (i + 1) % 2;
            d[i] = s.charAt(i) - 48;
            if(b[i] == d[i]){
                bb--;
            }
            if(c[i] == d[i]){
                cc--;
            }
        } {
            b[i] = i % 2;
            c[i] = (i + 1) % 2;
            d[i] = s.charAt(i) - 48;
            if(b[i] == d[i]){
                bb--;
            }
            if(c[i] == d[i]){
                cc--;
            }
        } b[i] = i % 2 b[i] b i i % 2 i 2 c[i] = (i + 1) % 2 c[i] c i (i + 1) % 2 (i + 1) i 1 2 d[i] = s.charAt(i) - 48 d[i] d i s.charAt(i) - 48 s.charAt(i) s.charAt s i 48 if(b[i] == d[i]){
                bb--;
            } b[i] == d[i] b[i] b i d[i] d i {
                bb--;
            } bb-- bb if(c[i] == d[i]){
                cc--;
            } c[i] == d[i] c[i] c i d[i] d i {
                cc--;
            } cc-- cc if(bb > cc){
            System.out.println(cc);
        }else{
            System.out.println(bb);
        } bb > cc bb cc {
            System.out.println(cc);
        } System.out.println(cc) System.out.println System.out System System.out cc {
            System.out.println(bb);
        } System.out.println(bb) System.out.println System.out System System.out bb String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        int a = s.length();
        int[] b = new int[a];
        int[] c = new int[a];
        int[] d = new int[a];
        int bb = a;
        int cc = a;
        for(int i = 0 ; i < a ; i++ ){
            b[i] = i % 2;
            c[i] = (i + 1) % 2;
            d[i] = s.charAt(i) - 48;
            if(b[i] == d[i]){
                bb--;
            }
            if(c[i] == d[i]){
                cc--;
            }
        }
        if(bb > cc){
            System.out.println(cc);
        }else{
            System.out.println(bb);
        }
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        int a = s.length();
        int[] b = new int[a];
        int[] c = new int[a];
        int[] d = new int[a];
        int bb = a;
        int cc = a;
        for(int i = 0 ; i < a ; i++ ){
            b[i] = i % 2;
            c[i] = (i + 1) % 2;
            d[i] = s.charAt(i) - 48;
            if(b[i] == d[i]){
                bb--;
            }
            if(c[i] == d[i]){
                cc--;
            }
        }
        if(bb > cc){
            System.out.println(cc);
        }else{
            System.out.println(bb);
        }
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();
        int a = s.length();
        int[] b = new int[a];
        int[] c = new int[a];
        int[] d = new int[a];
        int bb = a;
        int cc = a;
        for(int i = 0 ; i < a ; i++ ){
            b[i] = i % 2;
            c[i] = (i + 1) % 2;
            d[i] = s.charAt(i) - 48;
            if(b[i] == d[i]){
                bb--;
            }
            if(c[i] == d[i]){
                cc--;
            }
        }
        if(bb > cc){
            System.out.println(cc);
        }else{
            System.out.println(bb);
        }
    }
}