#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int w = 0, b = 0, fw = 0;
  bool fbb = true, fwb = false;
  int i;
  for (i = n - 1; 0 <= i; i--) {
    if (fbb) {
      if (s.at(i) == '.') {
        fbb = false;
        fwb = true;
      }
    }
    if (fwb) {
      if (s.at(i) == '#') {
        fwb = false;
        b++;
      } else {
        fw++;
      }
    } else {
      if (s.at(i) == '#') {
        b++;
      } else {
        w++;
      }
    }
  }
  cout << min(fw + w, min(fw + w, b)) << endl;
  return 0;
}
