#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool st = false;
  int wc = 0;
  for (int i = 0; i < n; i++) {
    if (st) {
      if (s[i] == '.') {
        wc++;
      }
    } else {
      if (s[i] == '#') {
        st = true;
      }
    }
  }
  st = false;
  int bc = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (st) {
      if (s[i] == '#') {
        bc++;
      }
    } else {
      if (s[i] == '.') {
        st = true;
      }
    }
  }
  cout << min(bc, wc) << endl;
}
