#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  int hcnt = 0;
  int bcnt = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i <= N; ++i) {
    if (S[i] == '#' && S[i + 1] == '.') ++bcnt;
    if (S[i] == '.' && S[i + 1] == '#') ++hcnt;
  }
  if (hcnt >= bcnt)
    cout << hcnt << "\n";
  else
    cout << bcnt << "\n";
  return 0;
}
