#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int w2b_res = 0, w2b_idx = 0;
  for (; w2b_idx < n && s[w2b_idx] == '.'; w2b_idx++) {
  }
  for (; w2b_idx < n; w2b_idx++) {
    if (s[w2b_idx] == '.') {
      w2b_res++;
    }
  }
  int b2w_res = 0, b2w_idx = n - 1;
  for (; b2w_idx >= 0 && s[b2w_idx] == '#'; b2w_idx--) {
  }
  for (; b2w_idx >= 0; b2w_idx--) {
    if (s[b2w_idx] == '#') {
      b2w_res++;
    }
  }
  cout << (w2b_res < b2w_res ? w2b_res : b2w_res) << endl;
}
