#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool wflg = false;
  int wcnt = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (wflg) {
      if (s[i] == '.') wcnt++;
    }
    if (s[i] == '#') wflg = true;
  }
  bool bflg = false;
  int bcnt = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (bflg) {
      if (s[i] == '#') bcnt++;
    }
    if (s[i] == '.') bflg = true;
  }
  if (wflg | bflg)
    cout << min(wcnt, bcnt) << endl;
  else
    cout << 0 << endl;
}
