#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k;
  cin >> n;
  string s;
  cin >> s;
  int cntb = 0, cntw = 0, flag = 1, ans = 0;
  for (int y = 0; y < n; y++) {
    if (s[y] == '.' && !flag)
      continue;
    else {
      flag = 1;
      while (y < n) {
        if (s[y] == '.')
          cntw++;
        else
          cntb++;
        y++;
      }
    }
  }
  cout << min(cntw, cntb) << "\n";
  return 0;
}
