#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  string S;
  cin >> n >> S;
  bool f = false;
  int ans = 0;
  int sna = 0;
  for (int i = 0; i < n; i++) {
    if (S[i] == '.' && f == true) {
      ans++;
    }
    if (S[i] == '#') {
      f = true;
    }
  }
  f = false;
  for (int i = n - 1; n >= 0; n--) {
    if (S[i] == '#' && f == true) {
      sna++;
    }
    if (S[i] == '.') {
      f = true;
    }
  }
  cout << min(ans, sna) << endl;
}
