import java.lang.reflect.Array;
import java.util.*;

import static java.lang.Math.abs;

class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String[] b =  new String[c.length()];
        String[] d = new String[c.length()];
        b = c.split("");
        d = c.split("");
        int count =0;
        for(int i =0; i < c.length()-1 ; i++){
            if(b[i].equals(b[i+1])){
               b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1));
            count ++;
            }
        }
        int count1 =1;
        d[0] = Integer.toString(abs(Integer.parseInt(d[0]) - 1));
        for(int k=0; k < c.length() - 1; k++){
            if(d[k].equals(d[k+1])){
                d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1));
                count1 ++;
            }
        }
        if(count <= count1){
            System.out.println(count);
        }else if(count > count1){
            System.out.println(count1);
        }
    }
} import java.lang.reflect.Array; Array java.lang.reflect import java.util.*; util.* java import static java.lang.Math.abs; import static java.lang.Math.abs; import static java.lang.Math.abs; class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String[] b =  new String[c.length()];
        String[] d = new String[c.length()];
        b = c.split("");
        d = c.split("");
        int count =0;
        for(int i =0; i < c.length()-1 ; i++){
            if(b[i].equals(b[i+1])){
               b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1));
            count ++;
            }
        }
        int count1 =1;
        d[0] = Integer.toString(abs(Integer.parseInt(d[0]) - 1));
        for(int k=0; k < c.length() - 1; k++){
            if(d[k].equals(d[k+1])){
                d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1));
                count1 ++;
            }
        }
        if(count <= count1){
            System.out.println(count);
        }else if(count > count1){
            System.out.println(count1);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String[] b =  new String[c.length()];
        String[] d = new String[c.length()];
        b = c.split("");
        d = c.split("");
        int count =0;
        for(int i =0; i < c.length()-1 ; i++){
            if(b[i].equals(b[i+1])){
               b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1));
            count ++;
            }
        }
        int count1 =1;
        d[0] = Integer.toString(abs(Integer.parseInt(d[0]) - 1));
        for(int k=0; k < c.length() - 1; k++){
            if(d[k].equals(d[k+1])){
                d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1));
                count1 ++;
            }
        }
        if(count <= count1){
            System.out.println(count);
        }else if(count > count1){
            System.out.println(count1);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String[] b =  new String[c.length()];
        String[] d = new String[c.length()];
        b = c.split("");
        d = c.split("");
        int count =0;
        for(int i =0; i < c.length()-1 ; i++){
            if(b[i].equals(b[i+1])){
               b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1));
            count ++;
            }
        }
        int count1 =1;
        d[0] = Integer.toString(abs(Integer.parseInt(d[0]) - 1));
        for(int k=0; k < c.length() - 1; k++){
            if(d[k].equals(d[k+1])){
                d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1));
                count1 ++;
            }
        }
        if(count <= count1){
            System.out.println(count);
        }else if(count > count1){
            System.out.println(count1);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String c = sc.next(); c sc.next() sc.next sc String[] b =  new String[c.length()]; b new String[c.length()] c.length() c.length c String[] d = new String[c.length()]; d new String[c.length()] c.length() c.length c b = c.split("") b c.split("") c.split c "" d = c.split("") d c.split("") c.split c "" int count =0; count 0 for(int i =0; i < c.length()-1 ; i++){
            if(b[i].equals(b[i+1])){
               b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1));
            count ++;
            }
        } int i =0; int i =0; i 0 i < c.length()-1 i c.length()-1 c.length() c.length c 1 i++ i++ i {
            if(b[i].equals(b[i+1])){
               b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1));
            count ++;
            }
        } {
            if(b[i].equals(b[i+1])){
               b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1));
            count ++;
            }
        } if(b[i].equals(b[i+1])){
               b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1));
            count ++;
            } b[i].equals(b[i+1]) b[i].equals b[i] b i b[i+1] b i+1 i 1 {
               b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1));
            count ++;
            } b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1)) b[i+1] b i+1 i 1 Integer.toString(abs(Integer.parseInt(b[i+1]) - 1)) Integer.toString Integer abs(Integer.parseInt(b[i+1]) - 1) abs Integer.parseInt(b[i+1]) - 1 Integer.parseInt(b[i+1]) Integer.parseInt Integer b[i+1] b i+1 i 1 1 count ++ count int count1 =1; count1 1 d[0] = Integer.toString(abs(Integer.parseInt(d[0]) - 1)) d[0] d 0 Integer.toString(abs(Integer.parseInt(d[0]) - 1)) Integer.toString Integer abs(Integer.parseInt(d[0]) - 1) abs Integer.parseInt(d[0]) - 1 Integer.parseInt(d[0]) Integer.parseInt Integer d[0] d 0 1 for(int k=0; k < c.length() - 1; k++){
            if(d[k].equals(d[k+1])){
                d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1));
                count1 ++;
            }
        } int k=0; int k=0; k 0 k < c.length() - 1 k c.length() - 1 c.length() c.length c 1 k++ k++ k {
            if(d[k].equals(d[k+1])){
                d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1));
                count1 ++;
            }
        } {
            if(d[k].equals(d[k+1])){
                d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1));
                count1 ++;
            }
        } if(d[k].equals(d[k+1])){
                d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1));
                count1 ++;
            } d[k].equals(d[k+1]) d[k].equals d[k] d k d[k+1] d k+1 k 1 {
                d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1));
                count1 ++;
            } d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1)) d[k+1] d k+1 k 1 Integer.toString(abs(Integer.parseInt(d[k+1]) - 1)) Integer.toString Integer abs(Integer.parseInt(d[k+1]) - 1) abs Integer.parseInt(d[k+1]) - 1 Integer.parseInt(d[k+1]) Integer.parseInt Integer d[k+1] d k+1 k 1 1 count1 ++ count1 if(count <= count1){
            System.out.println(count);
        }else if(count > count1){
            System.out.println(count1);
        } count <= count1 count count1 {
            System.out.println(count);
        } System.out.println(count) System.out.println System.out System System.out count if(count > count1){
            System.out.println(count1);
        } count > count1 count count1 {
            System.out.println(count1);
        } System.out.println(count1) System.out.println System.out System System.out count1 String[] args args
import java.lang.reflect.Array;
import java.util.*;

import static java.lang.Math.abs;

class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String c = sc.next();
        String[] b =  new String[c.length()];
        String[] d = new String[c.length()];
        b = c.split("");
        d = c.split("");
        int count =0;
        for(int i =0; i < c.length()-1 ; i++){
            if(b[i].equals(b[i+1])){
               b[i+1] = Integer.toString(abs(Integer.parseInt(b[i+1]) - 1));
            count ++;
            }
        }
        int count1 =1;
        d[0] = Integer.toString(abs(Integer.parseInt(d[0]) - 1));
        for(int k=0; k < c.length() - 1; k++){
            if(d[k].equals(d[k+1])){
                d[k+1] = Integer.toString(abs(Integer.parseInt(d[k+1]) - 1));
                count1 ++;
            }
        }
        if(count <= count1){
            System.out.println(count);
        }else if(count > count1){
            System.out.println(count1);
        }
    }
}
