#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int black = 0;
  int white = 0;
  int flag0 = 0;
  int flag1 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      flag0 = i;
      break;
    }
  }
  for (int i = flag0; i < n; i++) {
    if (s[i] == '.') {
      white++;
      flag1 = i;
    }
  }
  for (int i = 0; i < flag1; i++) {
    if (s[i] == '#') {
      black++;
    }
  }
  cout << min(black, white) << endl;
  return 0;
}
