#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int ans = 0;
  vector<int> vec(n);
  int l, r;
  l = 0;
  r = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '.') {
      l++;
    } else {
      break;
    }
  }
  for (int i = n - 1; i > -1; i--) {
    if (s.at(i) == '#') {
      r++;
    } else {
      break;
    }
  }
  int wnum, bnum;
  wnum = 0;
  bnum = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '.') {
      wnum++;
    } else {
      bnum++;
    }
  }
  cout << min(bnum, wnum) << endl;
}
