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

#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int count;
  cin >> count;
  string arr;
  cin >> arr;
  char first_color = arr[0] == 'r' ? 'r' : 'b';
  int FCS = 0;
  int SCS = 0;
  for (int i = 0; i < count; i++) {
    if (i % 2 == 0 && arr[i] != first_color) {
      ++SCS;
    } else if (i % 2 == 1 && arr[i] == first_color) {
      ++FCS;
    }
  }
  int first_state = 0;
  first_state = FCS > SCS ? FCS : SCS;
  char first_color_2 = arr[0] == 'r' ? 'b' : 'r';
  int FCS_2 = 0;
  int SCS_2 = 0;
  for (int i = 0; i < count; i++) {
    if (i % 2 == 0 && arr[i] != first_color_2) {
      ++SCS_2;
    } else if (i % 2 == 1 && arr[i] == first_color_2) {
      ++FCS_2;
    }
  }
  int second_state = 0;
  second_state = FCS_2 > SCS_2 ? FCS_2 : SCS_2;
  cout << (first_state < second_state ? first_state : second_state);
  return 0;
}
