#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n;
  cin >> n >> s;
  int flgb = 0;
  int ansb = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      flgb = 1;
    }
    if (flgb && s[i] == '.') {
      ansb++;
    }
  }
  int flgw = 0;
  int answ = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      flgw = 1;
    }
    if (flgw && s[i] == '#') {
      answ++;
    }
  }
  int ans = min(ansb, answ);
  cout << ans << endl;
}
