#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int i;
  int point = 1000000;
  int countb = 0;
  int countw = 0;
  int ch = 0;
  for (i = 0; i < n; i++) {
    if (s.at(i) == '#') {
      point = i;
      break;
    }
  }
  if (point == 1000000) {
    ch = 1;
  } else {
    for (i = point; i < n; i++) {
      if (s.at(i) == '#') {
        countb++;
      } else {
        countw++;
      }
    }
  }
  cout << min(countb, countw) << endl;
}
