#include <bits/stdc++.h>
using namespace std;
int main(void) {
  bool judge = false;
  long int n, countS = 0, countD = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (!judge && s[i] == '.') {
      continue;
    } else {
      judge = true;
    }
    if (judge) {
      if (s[i] == '#') {
        countS++;
      } else {
        countD++;
      }
    }
  }
  cout << min(countS, countD) << endl;
  return 0;
}
