#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  bool flaga = false, flagb = false;
  for (int i = 0; i < n; ++i) {
    static char a;
    cin >> a;
    s.push_back(a);
  }
  int ansb = 0, answ = 0;
  int aa = 0;
  for (int i = 0; i < n; ++i) {
    if (s.at(n - i - 1) == '.') break;
    ++aa;
  }
  for (int i = 0; i < n; ++i) {
    if (i < n - aa) {
      if (!flaga) {
        if (s.at(i) == '.') flaga = !flaga;
      } else {
        if (s.at(i) == '#') ++ansb;
      }
    }
    if (!flagb) {
      if (s.at(i) == '#') flagb = !flagb;
    } else {
      if (s.at(i) == '.') ++answ;
    }
  }
  cout << min(ansb, answ) << endl;
  return 0;
}
