#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int allw = 0, allb = 0;
  int last = n - 1;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      last = i + 1;
      break;
    }
  }
  for (int i = 0; i < last; i++) {
    if (s[i] == '.') {
      allb++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '#' && i != n - 1) {
      allw++;
    }
  }
  printf("%d\n", min(allw, allb));
  return 0;
}
