#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int nw = 0, nb = 0, nw0 = 0, nb0 = 0;
  for (auto&& w : s) {
    if (w == '.') nw++;
  }
  nb = s.size() - nw;
  int ans;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      nw0++;
    } else {
      break;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#') {
      nb0++;
    } else {
      break;
    }
  }
  cout << min(nw - nw0, nb - nb0) << endl;
}
