#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int N;
  string S;
  cin >> N;
  cin >> S;
  bool firstblack = false;
  int wCount = 0;
  int bCount = 0;
  int first_bCount = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.' && firstblack == true) {
      wCount++;
    }
    if (S[i] == '#') {
      if (firstblack == false) {
        firstblack = true;
      }
      bCount++;
    }
  }
  if (bCount > wCount) {
    cout << wCount << endl;
  } else {
    cout << bCount << endl;
  }
  return 0;
}
