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() {
  string a;
  int n;
  scanf("%d", &n);
  cin >> a;
  int redcnt = 0, blackcnt = 0;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == 'r')
      ++redcnt;
    else if (a[i] == 'b')
      ++blackcnt;
  }
  int ans = 0;
  if (redcnt == n / 2 || blackcnt == n / 2) {
    if (redcnt > blackcnt) {
      for (int i = 0; i < a.size(); i += 2) {
        if (a[i] != 'r') ++ans;
      }
    } else if (redcnt < blackcnt) {
      for (int i = 0; i < a.size(); i += 2) {
        if (a[i] != 'b') ++ans;
      }
    } else {
      for (int i = 0; i < a.size(); i += 2) {
        if (a[i] != 'b') ++ans;
      }
      int Min = ans;
      ans = 0;
      for (int i = 0; i < a.size(); i += 2) {
        if (a[i] != 'r') ++ans;
      }
      if (Min > ans) Min = ans;
      ans = Min;
    }
  } else if (redcnt > blackcnt) {
    int num = redcnt - blackcnt;
    num /= 2;
    if (n % 2 == 0) {
      string temp = a;
      for (int i = 1; i < temp.size(); i += 2) {
        if (temp[i] == 'r') {
          num--;
          ++ans;
          temp[i] = 'b';
          if (num == 0) break;
        }
      }
      for (int i = 0; i < temp.size(); i += 2) {
        if (temp[i] != 'r') ++ans;
      }
      int Min = ans;
      temp = a;
      for (int i = 1; i < temp.size(); i += 2) {
        if (temp[i] == 'b') {
          num--;
          ++ans;
          temp[i] = 'r';
          if (num == 0) break;
        }
      }
      for (int i = 0; i < temp.size(); i += 2) {
        if (temp[i] != 'b') ++ans;
      }
      if (Min > ans) Min = ans;
      ans = Min;
    } else {
      for (int i = 1; i < a.size(); i += 2) {
        if (a[i] == 'r') {
          num--;
          ++ans;
          a[i] = 'b';
          if (num == 0) break;
        }
      }
      for (int i = 0; i < a.size(); i += 2) {
        if (a[i] != 'r') ++ans;
      }
    }
  } else if (blackcnt > redcnt) {
    int num = redcnt - blackcnt;
    num /= 2;
    if (n % 2 == 0) {
      string temp = a;
      for (int i = 1; i < temp.size(); i += 2) {
        if (temp[i] == 'b') {
          num--;
          ++ans;
          temp[i] = 'r';
          if (num == 0) break;
        }
      }
      for (int i = 0; i < temp.size(); i += 2) {
        if (temp[i] != 'b') ++ans;
      }
      int Min = ans;
      temp = a;
      for (int i = 1; i < temp.size(); i += 2) {
        if (temp[i] == 'r') {
          num--;
          ++ans;
          temp[i] = 'b';
          if (num == 0) break;
        }
      }
      for (int i = 0; i < temp.size(); i += 2) {
        if (temp[i] != 'r') ++ans;
      }
      if (Min > ans) Min = ans;
      ans = Min;
    } else {
      for (int i = 1; i < a.size(); i += 2) {
        if (a[i] == 'b') {
          num--;
          ++ans;
          a[i] = 'r';
          if (num == 0) break;
        }
      }
      for (int i = 0; i < a.size(); i += 2) {
        if (a[i] != 'b') ++ans;
      }
    }
  } else if (blackcnt == redcnt) {
    for (int i = 0; i < a.size(); i += 2) {
      if (a[i] != 'b') {
        ++ans;
      }
    }
    int min = ans;
    ans = 0;
    for (int i = 0; i < a.size(); i += 2) {
      if (a[i] != 'r') {
        ++ans;
      }
    }
    if (min > ans) min = ans;
    ans = min;
  }
  printf("%d", ans);
  return 0;
}
