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() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  map<char, long long> m;
  for (long long i = 0; i < n; i++) {
    m[s[i]]++;
  }
  string s1;
  if (m['b'] > m['r']) {
    for (long long i = 0; i < n; i++) {
      if (i % 2 == 0)
        s1.push_back('b');
      else
        s1.push_back('r');
    }
  } else {
    for (long long i = 0; i < n; i++) {
      if (i % 2 == 1)
        s1.push_back('b');
      else
        s1.push_back('r');
    }
  }
  long long count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] != s1[i]) count++;
  }
  if (abs(m['b'] - m['r']) > 1 and count != 0) {
    if (m['b'] != 0 and m['r'] != 0)
      cout << ceil(abs(count - abs(m['b'] - m['r']) + 1) / 2) << endl;
    else
      cout << abs(count - abs(m['b'] - m['r']) + 1) << endl;
    return 0;
  } else
    cout << count / 2 << endl;
  return 0;
}
