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