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;
bool visit[100100];
int main() {
  int N;
  string A;
  cin >> N >> A;
  N = A.length();
  memset(visit, false, sizeof(visit));
  char c = A[0];
  visit[0] = true;
  bool flag;
  int total = 0;
  for (int i = 1; i < A.length(); i++) {
    if (!visit[i]) {
      if (i % 2 == 0) {
        if (A[i] != c) {
          flag = false;
          for (int j = i; j < A.length(); j++) {
            if (!visit[j]) {
              if (A[j] == c) {
                total++;
                visit[j] = true;
                visit[i] = true;
                flag = true;
                break;
              }
            }
          }
          if (!flag) {
            total++;
            visit[i] = true;
          }
        }
      } else {
        if (A[i] == c) {
          flag = false;
          for (int j = i; j < A.length(); j++) {
            if (!visit[j]) {
              if (A[j] != c) {
                total++;
                visit[j] = true;
                visit[i] = true;
                flag = true;
                break;
              }
            }
          }
          if (!flag) {
            total++;
            visit[i] = true;
          }
        }
      }
    }
  }
  cout << total << endl;
}
