#include <bits/stdc++.h>
using namespace std;
int main(void) {
  unsigned long long n;
  string s;
  cin >> n >> s;
  unsigned long long blockCount = 0;
  unsigned long long whiteCount = 0;
  bool isFinding = false;
  bool isFinding2 = false;
  for (unsigned long long i = 0; i < n; i++) {
    if (!isFinding2) {
      if (s.substr(i, 1) == "#") {
        isFinding = true;
        continue;
      }
    }
    if (isFinding) {
      if (s.substr(i, 1) == ".") {
        isFinding2 = true;
      }
    }
    if (isFinding2) {
      if (s.substr(i, 1) == "#") {
        whiteCount++;
      } else if (s.substr(i, 1) == ".") {
        blockCount++;
      }
    }
  }
  if (isFinding2) {
    if (s.substr(n - 1, 1) == "#") {
      whiteCount--;
    }
  }
  if (blockCount > whiteCount)
    cout << whiteCount << endl;
  else
    cout << blockCount << endl;
  return 0;
}
