#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int asum = 0;
  int bsum = 0;
  bool frag = false;
  for (int i = 0; i < n; i++) {
    if (frag == false and s.at(i) == '.') {
      asum++;
    }
    if (s.at(i) == '#') {
      frag = true;
    }
  }
  frag = false;
  for (int i = n - 1; i >= 0; i--) {
    if (frag == false and s.at(i) == '#') {
      bsum++;
    }
    if (s.at(i) == '.') {
      frag = true;
    }
  }
  int u = 0;
  int t = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '#') {
      u++;
    } else {
      t++;
    }
  }
  u -= bsum;
  t -= asum;
  cout << min(u, t) << endl;
}
