#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  string s;
  while (cin >> n >> s) {
    vector<int> v;
    int cnt = 1;
    for (int i = 1; i < n; i++) {
      if (s[i] != s[i - 1])
        v.push_back(cnt), cnt = 1;
      else
        cnt++;
    }
    v.push_back(cnt);
    int cnt1 = 0;
    int cnt2 = 0;
    for (int i = 0; i < v.size(); i += 2) cnt1 += v[i];
    for (int i = 1; i < v.size(); i += 2) cnt2 += v[i];
    cout << min(cnt1, cnt2) << endl;
  }
  return 0;
}
