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