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.*;

public class AnatolyAndCockroaches {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    String s = in.next();
    
    int moves = 0;
    int i = 1;
    int j = i + 1;
    for (i = 1; i < n; i++) {
      if (s.charAt(i) == s.charAt(i - 1)) {
        for (j = i + 1; j < n; j++) {
          if (s.charAt(j) != s.charAt(i)) {
            s = s.substring(0, i) + s.charAt(j) + s.substring(i + 1, j) + s.charAt(i) + s.substring(j + 1);
            moves++;
            break;
          }
        }
        if (j == n) {
          break;
        }
      }
    }
    
    if (i != n) {
      char newChar;
      for (; i < n; i++) {
        if (s.charAt(i) == s.charAt(i - 1)) {
          if (s.charAt(i) == 'b') {
            newChar = 'r';
          } else {
            newChar = 'b';
          }
          s = s.substring(0, i) + newChar + s.substring(i + 1);
          moves++;
        }
      }
    }
    
    System.out.println(moves);
  }
}