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