#include <bits/stdc++.h>
using namespace std;
uint64_t allBlack(uint64_t N, const string &S) {
  uint64_t left = -1;
  for (uint64_t n = 0; n < N; ++n) {
    if (S[n] == '#') {
      left = n;
      break;
    }
  }
  if (left == static_cast<uint64_t>(-1)) {
    return 0;
  }
  uint64_t count = 0;
  for (uint64_t n = left; n < N; ++n) {
    if (S[n] == '.') {
      ++count;
    }
  }
  return count;
}
uint64_t allWhite(uint64_t N, const string &S) {
  uint64_t count = 0;
  for (uint64_t n = 0; n < N; ++n) {
    if (S[n] == '#') {
      ++count;
    }
  }
  return count;
}
int main(int argc, char **argv) {
  uint64_t N;
  cin >> N;
  string S;
  cin >> S;
  cout << min(allBlack(N, S), allWhite(N, S)) << endl;
  return 0;
}
