#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int i = 0;
  int fw = 0;
  while (s[i] == '.') {
    fw++;
    i++;
  }
  reverse(s.begin(), s.end());
  i = 0;
  int fb = 0;
  while (s[i] == '#') {
    fb++;
    i++;
  }
  int bc = 0;
  int wc = 0;
  for (unsigned long long i = 0; i < (n); ++i) {
    s[i] == '#' ? bc++ : wc++;
  }
  cout << min(wc - fw, bc - fb);
}
