import java.util.*;

public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] n = sc.nextLine().toCharArray();
        char tmp = n[0];
        int count = 0;
        for(int i = 0;i<n.length;i++){
            if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            }
        }
        System.out.println(count);
    }
} import java.util.*; util.* java public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] n = sc.nextLine().toCharArray();
        char tmp = n[0];
        int count = 0;
        for(int i = 0;i<n.length;i++){
            if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            }
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] n = sc.nextLine().toCharArray();
        char tmp = n[0];
        int count = 0;
        for(int i = 0;i<n.length;i++){
            if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            }
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        char[] n = sc.nextLine().toCharArray();
        char tmp = n[0];
        int count = 0;
        for(int i = 0;i<n.length;i++){
            if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            }
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) char[] n = sc.nextLine().toCharArray(); n sc.nextLine().toCharArray() sc.nextLine().toCharArray sc.nextLine() sc.nextLine sc char tmp = n[0]; tmp n[0] n 0 int count = 0; count 0 for(int i = 0;i<n.length;i++){
            if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            }
        } int i = 0; int i = 0; i 0 i<n.length i n.length n n.length i++ i++ i {
            if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            }
        } {
            if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            }
        } if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            } n.length-1 != i n.length-1 n.length n n.length 1 i {
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            } if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                } n[i] == n[i+1] n[i] n i n[i+1] n i+1 i 1 {
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                } count++ count if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    } n[i] == '0' n[i] n i '0' {
                        n[i+1] = '1';
                    } n[i+1] = '1' n[i+1] n i+1 i 1 '1' {
                        n[i+1] = '0';
                    } n[i+1] = '0' n[i+1] n i+1 i 1 '0' 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);
        char[] n = sc.nextLine().toCharArray();
        char tmp = n[0];
        int count = 0;
        for(int i = 0;i<n.length;i++){
            if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            }
        }
        System.out.println(count);
    }
} public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] n = sc.nextLine().toCharArray();
        char tmp = n[0];
        int count = 0;
        for(int i = 0;i<n.length;i++){
            if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            }
        }
        System.out.println(count);
    }
} Main
import java.util.*;

public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] n = sc.nextLine().toCharArray();
        char tmp = n[0];
        int count = 0;
        for(int i = 0;i<n.length;i++){
            if(n.length-1 != i){
                if(n[i] == n[i+1]){
                    count++;
                    if(n[i] == '0'){
                        n[i+1] = '1';
                    }else{
                        n[i+1] = '0';
                    }
                }
            }
        }
        System.out.println(count);
    }
}