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