#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int startb;
  int startw;
  int count = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      startb = i;
      break;
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S.at(i) == '.') {
      startw = i;
      break;
    }
  }
  int countw = 0;
  int countb = 0;
  for (int i = startb; i <= startw; i++) {
    if (S.at(i) == '#') {
      countb++;
    }
    if (S.at(i) == '.') {
      countw++;
    }
  }
  cout << min(countb, countw) << endl;
}
