#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  bool wflag = false, bflag = false;
  long white = 0, black = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      wflag = true;
    }
    if (wflag) {
      if (s[i] == '.') {
        white++;
      }
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      bflag = true;
    }
    if (bflag) {
      if (s[i] == '#') {
        black++;
      }
    }
  }
  if (black <= white) {
    cout << black << endl;
  } else {
    cout << white << endl;
  }
}
