#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int w = 0, b = 0, cnt = 0;
  char prev = ' ';
  for (int i = 0; i < N; i++) {
    if (prev == ' ') {
      if (S[i] == '.')
        continue;
      else
        prev = '#';
    }
    if (prev == S[i]) {
      cnt++;
    } else {
      if (prev == '#') {
        b += cnt;
        cnt = 1;
      } else {
        w += cnt;
        cnt = 1;
      }
    }
    prev = S[i];
  }
  if (prev == '.') w += cnt;
  cout << min(w, b) << endl;
  return 0;
}
