#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  bool wasBlack = false;
  pair<int, int> lastB = make_pair(-1, -1);
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#') {
      if (!wasBlack) {
        lastB.first = i;
        lastB.second = -1;
      }
      wasBlack = true;
    }
    if (S[i] == '.') {
      if (wasBlack) {
        lastB.second = i - 1;
      }
      wasBlack = false;
    }
  }
  if (wasBlack) {
    lastB.second = N - 1;
  }
  if (lastB.first == -1) {
    cout << 0 << endl;
    return 0;
  }
  int nBlack = 0;
  int nWhite = 0;
  for (int i = 0; i < lastB.first; ++i) {
    if (S[i] == '.') {
      nWhite++;
    } else {
      nBlack++;
    }
  }
  if (lastB.second < N - 1) {
    nBlack += (N - 1) - lastB.second;
    nWhite += (N - 1) - lastB.second;
  }
  cout << min(nWhite, nBlack) << endl;
  return 0;
}
