166
rbbbbbbbbbbbbrbrrbbrbbbrbbbbbbbbbbrbbbbbbrbbbrbbbbbrbbbbbbbrbbbbbbbrbbrbbbbbbbbrbbbbbbbbbbbbbbrrbbbrbbbbbbbbbbbbbbrbrbbbbbbbbbbbrbbbbbbbbbbbbbbrbbbbbbbbbbbbbbbbbbbbbb
 7
rrbrbrb
 1
r
 2
bb
 18
rrrrrrrrrrrrrrrrrb
 8
rbbrbrbr
 1
b
 13
rbbbrbrrbrrbb
 100
brbbbrrrbbrbrbbrbbrbbbbrbbrrbbbrrbbbbrbrbbbbbbbbbbbbbbbbrrrrbbbbrrrbbbbbbbrbrrbrbbbbrrrbbbbrbbrbbbrb
 2
rb
 2
rr
 2
br

70
 1
 0
 1
 8
 1
 0
 3
 34
 0
 1
 0

import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
	    String s = sc.next();
	    char a = 'x';
	    char b = 'y';
	    StringBuilder sb = new StringBuilder();
	    char[] ch = s.toCharArray();
	    int count = 0;
	    for(int i=0; i < ch.length ; i++){
	    	if(i == 0){
	    		a = ch[i];
	    		sb.append(ch[i]);
	    	}else if(i == 1){
	    		if(ch[i] == a){
	    			if(a == 'r'){
	    				b = 'b';
	    				count++;
	    				sb.append(b);
	    			}else if(a == 'b'){
	    				b = 'r';
	    				count++;
	    				sb.append(b);
	    			}
	    		}else{
	    				b = ch[i];
	    				sb.append(b);
	    			
	    		}
	    	}else{
	    		if((i+1) % 2 == 1){
	    			if(ch[i] == b){
	    				ch[i] = a;
	    				count++;
	    				
	    			}
	    			sb.append(ch[i]);
	    			
	    		}else{
	    			if(ch[i] == a){
	    				ch[i] = b;
	    				count++;
	    				
	    			}
	    			sb.append(ch[i]);
	    		}
	    	}
	    }
	    
	    
	    System.out.println(count);
		
	}
}
