#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int n;
  cin >> n >> S;
  int w = 0, b = 0;
  bool f = false;
  for (int i = 0; i < n; i++) {
    if (S[i] == '#') {
      b++;
      f = true;
    }
    if (f) {
      if (S[i] == '.') {
        w++;
      }
    }
  }
  if (b < w) {
    cout << b << endl;
  } else {
    cout << w << endl;
  }
  return 0;
}
