import java.util.Scanner;

/**
 * @author subaru
 */
public class Main {
    // Coloring Colorfully
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int count0first = 0;
        int count1first = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            }
            if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            }

        }
        System.out.println(Math.min(count0first, count1first));
    }
} import java.util.Scanner; Scanner java.util public class Main {
    // Coloring Colorfully
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int count0first = 0;
        int count1first = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            }
            if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            }

        }
        System.out.println(Math.min(count0first, count1first));
    }
} Main // Coloring Colorfully
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int count0first = 0;
        int count1first = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            }
            if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            }

        }
        System.out.println(Math.min(count0first, count1first));
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int count0first = 0;
        int count1first = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            }
            if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            }

        }
        System.out.println(Math.min(count0first, count1first));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc int count0first = 0; count0first 0 int count1first = 0; count1first 0 for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            }
            if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            }

        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            }
            if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            }

        } {
            if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            }
            if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            }

        } if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            } S.charAt(i) == '1' && i % 2 == 0 S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' i % 2 == 0 i % 2 i 2 0 {
                count0first++;
            } count0first++ count0first if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            } S.charAt(i) == '0' && i % 2 == 1 S.charAt(i) == '0' S.charAt(i) S.charAt S i '0' i % 2 == 1 i % 2 i 2 1 {
                count0first++;
            } count0first++ count0first if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            } S.charAt(i) == '0' && i % 2 == 0 S.charAt(i) == '0' S.charAt(i) S.charAt S i '0' i % 2 == 0 i % 2 i 2 0 {
                count1first++;
            } count1first++ count1first if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            } S.charAt(i) == '1' && i % 2 == 1 S.charAt(i) == '1' S.charAt(i) S.charAt S i '1' i % 2 == 1 i % 2 i 2 1 {
                count1first++;
            } count1first++ count1first System.out.println(Math.min(count0first, count1first)) System.out.println System.out System System.out Math.min(count0first, count1first) Math.min Math count0first count1first String[] args args public class Main {
    // Coloring Colorfully
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int count0first = 0;
        int count1first = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            }
            if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            }

        }
        System.out.println(Math.min(count0first, count1first));
    }
} public class Main {
    // Coloring Colorfully
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int count0first = 0;
        int count1first = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            }
            if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            }

        }
        System.out.println(Math.min(count0first, count1first));
    }
} Main
import java.util.Scanner;

/**
 * @author subaru
 */
public class Main {
    // Coloring Colorfully
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int count0first = 0;
        int count1first = 0;
        for (int i = 0; i < S.length(); i++) {
            if (S.charAt(i) == '1' && i % 2 == 0) {
                count0first++;
            } else if (S.charAt(i) == '0' && i % 2 == 1) {
                count0first++;
            }
            if (S.charAt(i) == '0' && i % 2 == 0) {
                count1first++;
            } else if (S.charAt(i) == '1' && i % 2 == 1) {
                count1first++;
            }

        }
        System.out.println(Math.min(count0first, count1first));
    }
}
