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