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