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 n;
  scanf("%d", &n);
  string in;
  cin >> in;
  string rstart = "";
  string bstart = "";
  int flag = 0;
  for (int i = 0; i < n; i++) {
    if (flag == 0) {
      rstart += 'r';
      bstart += 'b';
    } else {
      rstart += 'b';
      bstart += 'r';
    }
    flag = !flag;
  }
  int rmiss = 0;
  int bmiss = 0;
  for (int i = 0; i < n; i++) {
    if (in[i] == 'a' && rstart[i] == 'b')
      rmiss++;
    else if (in[i] == 'b' && rstart[i] == 'b')
      bmiss++;
  }
  int ans1 = max(rmiss, bmiss);
  rmiss = 0;
  bmiss = 0;
  for (int i = 0; i < n; i++) {
    if (in[i] == 'a' && bstart[i] == 'b')
      rmiss++;
    else if (in[i] == 'b' && bstart[i] == 'a')
      bmiss++;
  }
  int ans2 = max(rmiss, bmiss);
  int ans = min(ans1, ans2);
  printf("%d\n", ans);
  return 0;
}
