#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, ii, cntb = 0, cntw = 0, cntbb = 0;
  string s;
  cin >> n >> s;
  bool flg = false;
  bool lastb = false;
  for (ii = 0; ii < n; ii++) {
    if (s[ii] == '#') {
      flg = true;
    }
    if (flg) {
      if (s[ii] == '#') {
        cntb++;
      } else {
        cntw++;
      }
    }
    if (ii == n - 1 && s[ii] == '#') {
      lastb = true;
    }
  }
  for (ii = n - 1; ii >= 0; ii--) {
    if (s[ii] == '#') {
      cntbb++;
    } else {
      break;
    }
  }
  cntb -= cntbb;
  if (cntb < cntw) {
    cout << cntb << endl;
  } else {
    cout << cntw << endl;
  }
  return 0;
}
