import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        StringBuilder pattern1 = new StringBuilder();
        StringBuilder pattern2 = new StringBuilder();
        for(int i = 0 ; i < s.length(); i++){
            if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            }
        }
        String pattern1_str = pattern1.toString();
        String pattern2_str = pattern2.toString();
        int pat1 =0;
        int pat2 =0;
        for(int i = 0 ; i < s.length(); i++){
            if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            }
        }
        if(pat1 >= pat2){
            System.out.println(pat2);
        }else{
            System.out.println(pat1);
        }
    }
} 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();
        StringBuilder pattern1 = new StringBuilder();
        StringBuilder pattern2 = new StringBuilder();
        for(int i = 0 ; i < s.length(); i++){
            if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            }
        }
        String pattern1_str = pattern1.toString();
        String pattern2_str = pattern2.toString();
        int pat1 =0;
        int pat2 =0;
        for(int i = 0 ; i < s.length(); i++){
            if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            }
        }
        if(pat1 >= pat2){
            System.out.println(pat2);
        }else{
            System.out.println(pat1);
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        StringBuilder pattern1 = new StringBuilder();
        StringBuilder pattern2 = new StringBuilder();
        for(int i = 0 ; i < s.length(); i++){
            if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            }
        }
        String pattern1_str = pattern1.toString();
        String pattern2_str = pattern2.toString();
        int pat1 =0;
        int pat2 =0;
        for(int i = 0 ; i < s.length(); i++){
            if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            }
        }
        if(pat1 >= pat2){
            System.out.println(pat2);
        }else{
            System.out.println(pat1);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        StringBuilder pattern1 = new StringBuilder();
        StringBuilder pattern2 = new StringBuilder();
        for(int i = 0 ; i < s.length(); i++){
            if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            }
        }
        String pattern1_str = pattern1.toString();
        String pattern2_str = pattern2.toString();
        int pat1 =0;
        int pat2 =0;
        for(int i = 0 ; i < s.length(); i++){
            if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            }
        }
        if(pat1 >= pat2){
            System.out.println(pat2);
        }else{
            System.out.println(pat1);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc StringBuilder pattern1 = new StringBuilder(); pattern1 new StringBuilder() StringBuilder pattern2 = new StringBuilder(); pattern2 new StringBuilder() for(int i = 0 ; i < s.length(); i++){
            if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            }
        } int i = 0 ; int i = 0 ; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            }
        } {
            if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            }
        } if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            } i % 2 == 0 i % 2 i 2 0 {
                pattern1.append("1");
                pattern2.append("0");
            } pattern1.append("1") pattern1.append pattern1 "1" pattern2.append("0") pattern2.append pattern2 "0" {
                pattern1.append("0");
                pattern2.append("1");
            } pattern1.append("0") pattern1.append pattern1 "0" pattern2.append("1") pattern2.append pattern2 "1" String pattern1_str = pattern1.toString(); pattern1_str pattern1.toString() pattern1.toString pattern1 String pattern2_str = pattern2.toString(); pattern2_str pattern2.toString() pattern2.toString pattern2 int pat1 =0; pat1 0 int pat2 =0; pat2 0 for(int i = 0 ; i < s.length(); i++){
            if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            }
        } int i = 0 ; int i = 0 ; i 0 i < s.length() i s.length() s.length s i++ i++ i {
            if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            }
        } {
            if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            }
        } if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            } s.charAt(i) == pattern1_str.charAt(i) s.charAt(i) s.charAt s i pattern1_str.charAt(i) pattern1_str.charAt pattern1_str i {
                pat1 += 1;
            } pat1 += 1 pat1 1 {
                pat2 += 1;
            } pat2 += 1 pat2 1 if(pat1 >= pat2){
            System.out.println(pat2);
        }else{
            System.out.println(pat1);
        } pat1 >= pat2 pat1 pat2 {
            System.out.println(pat2);
        } System.out.println(pat2) System.out.println System.out System System.out pat2 {
            System.out.println(pat1);
        } System.out.println(pat1) System.out.println System.out System System.out pat1 String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        StringBuilder pattern1 = new StringBuilder();
        StringBuilder pattern2 = new StringBuilder();
        for(int i = 0 ; i < s.length(); i++){
            if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            }
        }
        String pattern1_str = pattern1.toString();
        String pattern2_str = pattern2.toString();
        int pat1 =0;
        int pat2 =0;
        for(int i = 0 ; i < s.length(); i++){
            if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            }
        }
        if(pat1 >= pat2){
            System.out.println(pat2);
        }else{
            System.out.println(pat1);
        }
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        StringBuilder pattern1 = new StringBuilder();
        StringBuilder pattern2 = new StringBuilder();
        for(int i = 0 ; i < s.length(); i++){
            if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            }
        }
        String pattern1_str = pattern1.toString();
        String pattern2_str = pattern2.toString();
        int pat1 =0;
        int pat2 =0;
        for(int i = 0 ; i < s.length(); i++){
            if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            }
        }
        if(pat1 >= pat2){
            System.out.println(pat2);
        }else{
            System.out.println(pat1);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        StringBuilder pattern1 = new StringBuilder();
        StringBuilder pattern2 = new StringBuilder();
        for(int i = 0 ; i < s.length(); i++){
            if(i % 2 == 0){
                pattern1.append("1");
                pattern2.append("0");
            }else{
                pattern1.append("0");
                pattern2.append("1");
            }
        }
        String pattern1_str = pattern1.toString();
        String pattern2_str = pattern2.toString();
        int pat1 =0;
        int pat2 =0;
        for(int i = 0 ; i < s.length(); i++){
            if(s.charAt(i) == pattern1_str.charAt(i)){
                pat1 += 1;
            }else{
                pat2 += 1;
            }
        }
        if(pat1 >= pat2){
            System.out.println(pat2);
        }else{
            System.out.println(pat1);
        }
    }
}