#include <bits/stdc++.h>
using namespace std;
int main() {
  int64_t N, white = 0, black = 0;
  cin >> N;
  vector<char> S(N);
  bool cntWhite = false, cntBlack = false;
  for (int i = 0; i < N; i++) {
    cin >> S.at(i);
    if (S.at(i) == '#') {
      cntWhite = true;
    } else {
      if (cntWhite) white++;
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S.at(i) == '.') {
      cntBlack = true;
    } else {
      if (cntBlack) black++;
    }
  }
  cout << min(black, white) << endl;
}
