#include <bits/stdc++.h>
using namespace std;
string str;
int dp[1200][3];
int dp_func(int pos, int bef) {
  if (str[pos] == '\0') return 0;
  int ret = 21474836;
  if (dp[pos][bef] != -1) return dp[pos][bef];
  if (bef == 0) {
    if (str[pos - 1] != str[pos])
      ret = min(ret, dp_func(pos + 1, 0));
    else
      ret = min(ret, dp_func(pos + 1, 1) + 1);
  } else {
    if (str[pos - 1] != str[pos])
      ret = min(ret, dp_func(pos + 1, 1) + 1);
    else
      ret = min(ret, dp_func(pos + 1, 0));
  }
  return dp[pos][bef] = ret;
}
int main() {
  int n;
  cin >> n;
  cin >> str;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  memset(dp, -1, sizeof dp);
  int a = dp_func(1, 0);
  int b = dp_func(1, 1) + 1;
  cout << min(a, b) << endl;
}
